summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesper Jensen <jesper@slashwin.dk>2021-10-05 23:11:48 +0200
committerJesper Jensen <jesper@slashwin.dk>2021-10-05 23:11:48 +0200
commit2d8a92e57d68325994ac402d25b0b140a1534467 (patch)
tree051e3cc4abe02e86c692d93b2a7fed07a6633009 /src
parent8d621f02e02ffc030dd25c2d47e0da71a8f540fe (diff)
Add comment for hacky stuff
Diffstat (limited to 'src')
-rw-r--r--src/proto.c5
1 files changed, 5 insertions, 0 deletions
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;