Clean up download logic for missing/lost chunks

This commit is contained in:
2025-11-14 11:56:29 +01:00
parent 787807031b
commit 2bbe1ac0e8
5 changed files with 161 additions and 104 deletions
+14 -1
View File
@@ -1,3 +1,5 @@
#include "byte_queue.h"
#include "tcp.h"
#define _GNU_SOURCE
#include <string.h>
@@ -752,7 +754,18 @@ static int process_chunk_server_auth(MetadataServer *state,
// we accept all connections that provide valid address information.
chunk_server->auth = true;
// No need to respond
ByteQueue *output = tcp_output_buffer(&state->tcp, conn_idx);
assert(output);
MessageWriter writer;
message_writer_init(&writer, output, MESSAGE_TYPE_AUTH_RESPONSE);
// TODO: Check whether we already hold the chunk list
// of this chunk server. If we do, tell it.
if (!message_writer_free(&writer)) {
assert(0); // TODO
}
return 0;
}