Integration with newer versions of libmicrohttpd
was closing two times the file descriptor:
- one time by the websocket within afb
- one time by the upgrade close of libmicrohttpd
Thanks to 'autoclose' feature of 'fdev', the solution
is quiet easily.
Bug-AGL: SPEC-1345
Change-Id: Ifb691b3f69c095b5ff44bfd7f7267ea24d52df6d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
#include "afb-websock.h"
#include "afb-ws-json1.h"
#include "afb-fdev.h"
+#include "fdev.h"
/**************** WebSocket connection upgrade ****************************/
/* TODO */
close_websocket(urh);
} else {
+ fdev_set_autoclose(fdev, 0);
ws = memo->proto->create(fdev, memo->apiset, &memo->hreq->xreq.context, close_websocket, urh);
if (ws == NULL) {
/* TODO */