Clean up state update logic in chunk server

This commit is contained in:
2025-11-10 18:36:11 +01:00
parent ade03ac6f3
commit d25d79c1f1
4 changed files with 72 additions and 55 deletions
+6
View File
@@ -554,6 +554,8 @@ void tinydfs_result_free(TinyDFS_Result *result)
static void process_event_for_create(TinyDFS *tdfs,
int opidx, int request_tag, ByteView msg)
{
(void) request_tag;
if (msg.len == 0) {
tdfs->operations[opidx].result = (TinyDFS_Result) { .type=TINYDFS_RESULT_CREATE_ERROR };
return;
@@ -596,6 +598,8 @@ static void process_event_for_create(TinyDFS *tdfs,
static void process_event_for_delete(TinyDFS *tdfs,
int opidx, int request_tag, ByteView msg)
{
(void) request_tag;
if (msg.len == 0) {
tdfs->operations[opidx].result = (TinyDFS_Result) { .type=TINYDFS_RESULT_DELETE_ERROR };
return;
@@ -638,6 +642,8 @@ static void process_event_for_delete(TinyDFS *tdfs,
static void process_event_for_list(TinyDFS *tdfs,
int opidx, int request_tag, ByteView msg)
{
(void) request_tag;
if (msg.len == 0) {
tdfs->operations[opidx].result = (TinyDFS_Result) { .type=TINYDFS_RESULT_LIST_ERROR };
return;