Reject write operations with expect_gen=0

Per PROTOCOL.txt specification, WRITE operations must provide a valid
generation counter and cannot use expect_gen=0 (unlike other operations).

This ensures the client has retrieved the file's metadata and knows the
correct chunk size before writing.

Changes:
- Added FILETREE_BADGEN error code (-8)
- Modified file_tree_write() to reject expect_gen=0
- Added error message for FILETREE_BADGEN
This commit is contained in:
Claude
2025-11-24 12:46:27 +00:00
parent acb1336d47
commit 1281bf0822
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -13,6 +13,7 @@ enum {
FILETREE_EXISTS = -5,
FILETREE_BADPATH = -6,
FILETREE_BADOP = -7,
FILETREE_BADGEN = -8,
};
typedef struct Entity Entity;