diff options
| author | Jesper Jensen <jesper@jnsn.dev> | 2025-05-04 13:49:18 +0200 |
|---|---|---|
| committer | Jesper Jensen <jesper@jnsn.dev> | 2025-05-04 13:49:18 +0200 |
| commit | ce69e3e5bf0c6188fa7bc70021b7dde0e7752c9a (patch) | |
| tree | 1cad29b2a6c628a2681820746c555106115815ba /src/proto.c | |
| parent | b48676df767fa0e6384f8167997e44a79fdc3839 (diff) | |
Support for longer transaction IDs
Diffstat (limited to 'src/proto.c')
| -rw-r--r-- | src/proto.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; |
