diff options
| author | Jesper Jensen <jesper@slashwin.dk> | 2021-10-05 23:11:48 +0200 |
|---|---|---|
| committer | Jesper Jensen <jesper@slashwin.dk> | 2021-10-05 23:11:48 +0200 |
| commit | 2d8a92e57d68325994ac402d25b0b140a1534467 (patch) | |
| tree | 051e3cc4abe02e86c692d93b2a7fed07a6633009 | |
| parent | 8d621f02e02ffc030dd25c2d47e0da71a8f540fe (diff) | |
Add comment for hacky stuff
| -rw-r--r-- | src/proto.c | 5 |
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; |
