From 2d8a92e57d68325994ac402d25b0b140a1534467 Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Tue, 5 Oct 2021 23:11:48 +0200 Subject: Add comment for hacky stuff --- src/proto.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/proto.c') diff --git a/src/proto.c b/src/proto.c index cde232b..fa8ddc5 100644 --- a/src/proto.c +++ b/src/proto.c @@ -485,6 +485,9 @@ int handle_packet(struct dht* dht, time_t now, enum commandType type, char* tran rc = handle_request(&dht->self, query, packet, packet_len, &cursor, end-cursor-1); if(rc == QUERY_EUNK) { + // @FRAGILE: @HACK: Static offsets to fiddle with already written + // out packet data. Acceptable because this is the uncommon error + // case. // The y key should have value e *(cursor-4) = 'e'; // The r key is called e for errors @@ -511,6 +514,8 @@ int handle_packet(struct dht* dht, time_t now, enum commandType type, char* tran memcpy(&message->dest, remote, remote_len); message->dest_len = remote_len; (*msgbuff->messages)++; + } else { + fatal("HOW"); } return 0; -- cgit v1.2.3