From 39e9508260335eb5cd817e9899a11cb011efdbed Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 30 Mar 2012 11:37:58 +0200 Subject: Add observe protocol and connection handler. --- src/muniad.cc | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'src/muniad.cc') diff --git a/src/muniad.cc b/src/muniad.cc index 4523d8a..a414462 100644 --- a/src/muniad.cc +++ b/src/muniad.cc @@ -37,25 +37,18 @@ #include "http.h" #include "task_proto.h" - -/* list of supported protocols and callbacks */ +#include "observe_proto.h" static struct libwebsocket_protocols protocols[] = { - /* first protocol must always be HTTP handler */ - - { - "http-only", /* name */ - callback_http, /* callback */ - 0 /* per_session_data_size */ + // first protocol must always be HTTP handler + { "http-only", callback_http, 0 }, + { "lws-task-protocol", callback_lws_task, + sizeof(struct per_session_data__lws_task) }, - { - "lws-task-protocol", - callback_lws_task, - sizeof(struct per_session_data__lws_task) + { "lws-observe-protocol", callback_lws_observe, + sizeof(struct per_session_data__lws_observe) }, - { - NULL, NULL, 0 /* End of list */ - } + { NULL, NULL, 0 } // End of list }; static struct option options[] = { -- cgit v1.2.3