summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-10-30 12:33:51 -0400
committerAndrew Opalach <andrew@akon.city> 2025-10-30 12:33:51 -0400
commit9b7755c4c868cbf05da934644a3a3be2ea594170 (patch)
tree6b99db757e82d4e4630529dfd38e8bb909fcedd6 /src
parent36295da7869a8254b56afd2b73a239b4d9b81876 (diff)
downloadlibnaunet-9b7755c4c868cbf05da934644a3a3be2ea594170.tar.gz
libnaunet-9b7755c4c868cbf05da934644a3a3be2ea594170.tar.bz2
libnaunet-9b7755c4c868cbf05da934644a3a3be2ea594170.zip
Catch likely HTTP requests in multiplex
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src')
-rw-r--r--src/multiplex.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/multiplex.c b/src/multiplex.c
index a9eb5b4..40d7e75 100644
--- a/src/multiplex.c
+++ b/src/multiplex.c
@@ -1,4 +1,5 @@
#define AL_LOG_SECTION "multiplex"
+//#define AL_LOG_ENABLE_TRACE
#include <al/log.h>
#include "multiplex.h"
@@ -33,6 +34,17 @@ static void socket_read_callback(struct ev_loop *loop, ev_io *w, s32 revents)
return;
}
+ log_trace("ID byte: 0x%hhx.\n", id);
+ switch (id) {
+ case 0x48: // '(H)EAD'
+ break;
+ case 0x47: // '(G)ET'
+ // Attempt WebSocket upgrade.
+ break;
+ case 0x50: // '(P)OST'
+ break;
+ }
+
ev_io_stop(loop, &conn->event);
struct nn_packet_stream *stream = al_alloc_object(struct nn_packet_stream);