aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-hsrv.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-04-13 23:24:13 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-04-26 16:08:07 +0200
commit7e674cc7202abfae0dd07df8805a0dea743bf4be (patch)
treeb3351f2b72c800e4c856a7aa340915885b6184f3 /src/afb-hsrv.c
parentf2995647f0f79e816c7f46033e1ec824185732b5 (diff)
Use upgrade abitlity of libmicrohttpd
Since version 0.9.52, libmicrohttpd correctly handles upgrading of connections. Leveraging that feature is a best. Change-Id: Icde686cd9a3c12dda5ee74f354086ccff435796c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-hsrv.c')
-rw-r--r--src/afb-hsrv.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/afb-hsrv.c b/src/afb-hsrv.c
index f0866f82..87895a7b 100644
--- a/src/afb-hsrv.c
+++ b/src/afb-hsrv.c
@@ -231,8 +231,6 @@ static void end_handler(void *cls, struct MHD_Connection *connection, void **rec
hreq = *recordreq;
if (hreq) {
- if (hreq->upgrade)
- MHD_suspend_connection (connection);
afb_hreq_unref(hreq);
}
}
@@ -399,7 +397,7 @@ int afb_hsrv_start(struct afb_hsrv *hsrv, uint16_t port, unsigned int connection
const union MHD_DaemonInfo *info;
httpd = MHD_start_daemon(
- MHD_USE_EPOLL_LINUX_ONLY | MHD_USE_TCP_FASTOPEN | MHD_USE_DEBUG | MHD_USE_SUSPEND_RESUME,
+ MHD_USE_EPOLL | MHD_ALLOW_UPGRADE | MHD_USE_TCP_FASTOPEN | MHD_USE_DEBUG | MHD_USE_SUSPEND_RESUME,
port, /* port */
new_client_handler, NULL, /* Tcp Accept call back + extra attribute */
access_handler, hsrv, /* Http Request Call back + extra attribute */