// set these two according to your data
// rx buf size must be >= permessage-deflate rx size
#define MT_PROTOCOL_RX_BUFFER_SIZE 128
-#define INPUT_LINE_LENGTH 512
+#define INPUT_LINE_LENGTH MT_PROTOCOL_RX_BUFFER_SIZE
#define HTTP_PORT 80 // listen here
#define HTTP_MOUNTPOINT "/" // mountpoint URL
#define JSON_EMPTY "{\"type\":\"empty\"}" // default message
-typedef struct list {
+typedef struct node {
char *line;
- struct list *next;
+ struct node *next;
+} node;
+
+typedef struct list {
+ struct node *first;
+ struct node *last;
} list;
typedef struct ev_io_ws {