From ebfa3df4ad6998e3ee96a403609bfd2a599090e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ji=C5=99=C3=AD=20Mat=C4=9Bj=C3=A1k?= Date: Thu, 26 Apr 2018 18:02:34 +0200 Subject: [PATCH] remove timer remnants --- mt_rfid.c | 1 - mt_server.c | 21 ++++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/mt_rfid.c b/mt_rfid.c index 4f3b07c..1954b02 100644 --- a/mt_rfid.c +++ b/mt_rfid.c @@ -1,6 +1,5 @@ /** * mt_rfid.c - * poll the uFR reader and print JSON formatted card info to stdout. */ // shit to avoid constant repetition diff --git a/mt_server.c b/mt_server.c index fb5eb1b..76485d7 100644 --- a/mt_server.c +++ b/mt_server.c @@ -5,6 +5,8 @@ #include "mt_server.h" #include "ev_signal_exit.h" +#define JSON_EMPTY "{\"type\":\"empty\"}" + static const struct lws_http_mount mount = { /* .mount_next */ NULL, /* linked-list "next" */ /* .mountpoint */ "/", /* mountpoint URL */ @@ -39,8 +41,6 @@ typedef struct per_session_data__dumb_increment { int number; } per_session_data__dumb_increment; -#define JSON_EMPTY "{\"type\":\"empty\"}" - enum protocols { PROTOCOL_HTTP = 0, // always first PROTOCOL_MERICA_TERMINAL @@ -50,8 +50,7 @@ static int callback_merica_terminal(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); -/* list of supported protocols and callbacks */ - +// list of supported protocols and callbacks static struct lws_protocols protocols[] = { /* first protocol must always be HTTP handler */ {"http", lws_callback_http_dummy, 0, 0}, @@ -132,13 +131,6 @@ static int callback_merica_terminal(struct lws *wsi, return 0; } -/*static void ev_timeout_cb(EV_P_ ev_timer *w, int revents) -{ - lws_callback_on_writable_all_protocol(context, - &protocols[PROTOCOL_MERICA_TERMINAL]); -}*/ - - static void fd_cb(EV_P_ ev_io *w_, int revents) { ev_io_ws *w = (ev_io_ws *)w_; @@ -153,7 +145,6 @@ static void fd_cb(EV_P_ ev_io *w_, int revents) lws_callback_on_writable_all_protocol(w->context, &protocols[PROTOCOL_MERICA_TERMINAL]); } - } int mt_server_init(mt_server_t *self, struct ev_loop *loop, int fd) @@ -201,7 +192,7 @@ void mt_server_deinit(mt_server_t *self) #ifdef IS_MAIN int main(int argc, const char **argv) { - struct ev_loop *loop = ev_default_loop(0); + struct ev_loop *loop = EV_DEFAULT; mt_server_t server; set_signal_exit(loop); @@ -210,10 +201,6 @@ int main(int argc, const char **argv) return -1; } - //ev_timer timeout_watcher; - //ev_timer_init(&timeout_watcher, ev_timeout_cb, 1, 1); - //ev_timer_start(loop, &timeout_watcher); - ev_run(loop, 0); mt_server_deinit(&server); -- 2.39.2