From ce69e3e5bf0c6188fa7bc70021b7dde0e7752c9a Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Sun, 4 May 2025 13:49:18 +0200 Subject: Support for longer transaction IDs --- src/proto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/proto.c') diff --git a/src/proto.c b/src/proto.c index a0f6e94..9866c0a 100644 --- a/src/proto.c +++ b/src/proto.c @@ -736,7 +736,7 @@ int handle_packet(struct dht* dht, time_t now, enum commandType type, char* tran } else if(type == CT_QUERY) { // Must be a query if(transaction == NULL) fatal("No transaction in request"); - if(transaction_len > 16) { + if(transaction_len > 64) { prom_counter_inc(queries, (const char *[]){query, "discard"}); err("DISCARD: Transaction ID is too long"); return 0; @@ -951,7 +951,7 @@ int proto_run(struct dht* dht, char* buff, size_t recv_len, struct sockaddr_in* enum commandType type = CT_UNK; bool transaction_set = false; - char transaction[64]; + char transaction[65]; size_t transaction_len; bool query_set = false; char query[64]; @@ -976,7 +976,7 @@ int proto_run(struct dht* dht, char* buff, size_t recv_len, struct sockaddr_in* case 1: { // Skip the key bcur_next(&bcursor, 1); - if(bcursor.readhead->size > 64-1) + if(bcursor.readhead->size > 64) fatal("Transaction string too long"); transaction_set = true; -- cgit v1.2.3