aboutsummaryrefslogtreecommitdiff
path: root/websocksy.h
diff options
context:
space:
mode:
Diffstat (limited to 'websocksy.h')
-rw-r--r--websocksy.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/websocksy.h b/websocksy.h
index 36a713d..0fc9538 100644
--- a/websocksy.h
+++ b/websocksy.h
@@ -1,6 +1,14 @@
#include <stdint.h>
#include <stdlib.h>
+#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;