X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-ws-client.c;h=f00707c341f608342dca86ab0f3476bb1aa6fc27;hb=9b1f8506d92d34fc51763561421b393aaf040d90;hp=de44a398e5046233650c345cf5c609e8c0708205;hpb=404f24c13cb45bd3e9ca837bc033fd6840cbf669;p=src%2Fapp-framework-binder.git diff --git a/src/afb-ws-client.c b/src/afb-ws-client.c index de44a398..f00707c3 100644 --- a/src/afb-ws-client.c +++ b/src/afb-ws-client.c @@ -29,7 +29,6 @@ #include #include "afb-wsj1.h" -#include "afb-common.h" /**************** WebSocket handshake ****************************/ @@ -52,14 +51,6 @@ static const char *compkeys[32] = { "MHiEc+Qc8w/SJ3zMHEM8pA==", "FVCxLBmoil3gY0jSX3aNJ6kR/t4=" }; -static const char websocket_s[] = "websocket"; -static const char sec_websocket_key_s[] = "Sec-WebSocket-Key"; -static const char sec_websocket_version_s[] = "Sec-WebSocket-Version"; -static const char sec_websocket_accept_s[] = "Sec-WebSocket-Accept"; -static const char sec_websocket_protocol_s[] = "Sec-WebSocket-Protocol"; - -static const char vseparators[] = " \t,"; - /* get randomly a pair of key/accept value */ static void getkeypair(const char **key, const char **ack) { @@ -315,7 +306,6 @@ invalid: errno = EINVAL; error: return -1; - } @@ -323,7 +313,7 @@ error: static const char *proto_json1[2] = { "x-afb-ws-json1", NULL }; -struct afb_wsj1 *afb_ws_client_connect_wsj1(const char *uri, struct afb_wsj1_itf *itf, void *closure) +struct afb_wsj1 *afb_ws_client_connect_wsj1(struct sd_event *eloop, const char *uri, struct afb_wsj1_itf *itf, void *closure) { int rc, fd; char *host, *service, xhost[32]; @@ -364,7 +354,7 @@ struct afb_wsj1 *afb_ws_client_connect_wsj1(const char *uri, struct afb_wsj1_itf if (rc == 0) { rc = negociate(fd, proto_json1, path, xhost); if (rc == 0) { - result = afb_wsj1_create(fd, itf, closure); + result = afb_wsj1_create(eloop, fd, itf, closure); if (result != NULL) { fcntl(fd, F_SETFL, O_NONBLOCK); break; @@ -407,15 +397,4 @@ static char *makequery(const char *path, const char *uuid, const char *token) } #endif -/* - * - * Returns the internal event loop coming from afb-common - * - * Returns the handle to the event loop - */ -struct sd_event *afb_ws_client_get_event_loop() -{ - return afb_common_get_event_loop(); -} -