X-Git-Url: https://rtime.felk.cvut.cz/gitweb/coffee/mt-apps.git/blobdiff_plain/d3f765105f7fcd79d3e2501c58288c1abf32e41f..HEAD:/mt_server.h diff --git a/mt_server.h b/mt_server.h index bf7c6e2..5beb9dd 100644 --- a/mt_server.h +++ b/mt_server.h @@ -7,18 +7,32 @@ // 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 +#if defined(SIM) +#define HTTP_PORT 8080 // listen here +#define HTTP_ORIGIN "html" // where the html files are +#else #define HTTP_PORT 80 // listen here -#define HTTP_MOUNTPOINT "/" // mountpoint URL #define HTTP_ORIGIN "/usr/share/mtserver" // where the html files are +#endif +#define HTTP_MOUNTPOINT "/" // mountpoint URL #define HTTP_DEFAULT "index.html" // default filename -#define JSON_EMPTY "{\"type\":\"empty\"}" // default message +typedef struct node { + char *line; + struct node *next; +} node; + +typedef struct list { + struct node *first; + struct node *last; +} list; typedef struct ev_io_ws { ev_io w; // input watcher struct lws_context *context; + list *lines; char *text; // input buffer pointer char *pos; // input buffer current position pointer } ev_io_ws;