X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hsrv.c;h=afe865f78afaec67024a522425ebc003c0e8555f;hb=c0453c34a58aac8150300ab829149a0ca4d9e5ee;hp=64cea9d5ed615cbbfa3ce7eab5a9f1b4d63b0d98;hpb=fb230eee946673ed5ebe9659d623c2a06d0a80ce;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hsrv.c b/src/afb-hsrv.c index 64cea9d5..afe865f7 100644 --- a/src/afb-hsrv.c +++ b/src/afb-hsrv.c @@ -56,6 +56,12 @@ struct afb_diralias { int dirfd; }; +struct afb_hsrv { + struct MHD_Daemon *httpd; + struct afb_hsrv_handler *handlers; + struct upoll *upoll; +}; + static struct upoll *upoll = NULL; static struct afb_hsrv_handler *new_handler( @@ -152,11 +158,8 @@ static int afb_hreq_websocket_switch(struct afb_hreq *hreq, void *data) if (!later) { struct afb_websock *ws = afb_websock_create(hreq); - if (ws == NULL) { - /* TODO */ - } else { - /* TODO */ - } + if (ws != NULL) + hreq->upgrade = 1; } return 1; } @@ -306,6 +309,7 @@ static int access_handler( hreq->postform = MHD_create_post_processor (connection, 65500, postproc, hreq); if (hreq->postform == NULL) goto internal_error; + return MHD_YES; } else if (strcasestr(type, JSON_CONTENT) == NULL) { afb_hsrv_reply_error(connection, MHD_HTTP_UNSUPPORTED_MEDIA_TYPE); return MHD_YES;