From 10874eb2195d3e6ceed8e8a76aaf4455e41c8683 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 12 May 2019 23:18:03 +0200 Subject: Client handling --- websocksy.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'websocksy.h') diff --git a/websocksy.h b/websocksy.h index 36a713d..0fc9538 100644 --- a/websocksy.h +++ b/websocksy.h @@ -1,6 +1,14 @@ #include #include +#define WS_MAX_LINE 16384 + +typedef enum { + ws_new = 0, + ws_http, + ws_rfc6455 +} ws_state; + struct { char* host; char* port; @@ -19,6 +27,10 @@ typedef struct { } ws_proto; typedef struct /*_web_socket*/ { + uint8_t read_buffer[WS_MAX_LINE]; + size_t read_buffer_offset; + ws_state state; + int fd; size_t protocols; ws_proto* protocol; -- cgit v1.2.3