X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fafb-hswitch.c;h=d531155db1391a4d7cf77dfcb4d66d5e06951e65;hb=6ea1d50ab6571551e1d0379940349911956c97ee;hp=3fcd77de601d7d1db68ac8a2a4eedb5fcb8fcbc4;hpb=54b2652e94cfa7840dbebcba46edd5459e7c6e86;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hswitch.c b/src/afb-hswitch.c index 3fcd77de..d531155d 100644 --- a/src/afb-hswitch.c +++ b/src/afb-hswitch.c @@ -74,18 +74,10 @@ int afb_hswitch_one_page_api_redirect(struct afb_hreq *hreq, void *data) int afb_hswitch_websocket_switch(struct afb_hreq *hreq, void *data) { - int later; - - afb_hreq_context(hreq); - if (hreq->lentail != 0 || !afb_websock_check(hreq, &later)) + if (hreq->lentail != 0) return 0; - if (!later) { - struct afb_websock *ws = afb_websock_create(hreq); - if (ws != NULL) - hreq->upgrade = 1; - } - return 1; + return afb_websock_check_upgrade(hreq /* TODO: protocols here */); }