diff options
author | 2016-07-12 16:14:51 +0200 | |
---|---|---|
committer | 2016-07-12 14:35:23 +0000 | |
commit | 404f24c13cb45bd3e9ca837bc033fd6840cbf669 (patch) | |
tree | bbc282179848f319c8a2e21193413ab9ddc03064 /src/afb-ws-client.c | |
parent | bca90021828565bddb8624e8f6370bf4959cbfbf (diff) |
afb-client-demo/afb-ws: remove dependency on afb-common.*
afb-common.* files are not public and so not distributed
in any development package. This makes difficult to create
a client with sources out-of-tree.
Change-Id: Ib2edd48f864f55821ab590442efdf6d1e2fdcd58
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'src/afb-ws-client.c')
-rw-r--r-- | src/afb-ws-client.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/afb-ws-client.c b/src/afb-ws-client.c index e9c1a906..de44a398 100644 --- a/src/afb-ws-client.c +++ b/src/afb-ws-client.c @@ -29,6 +29,7 @@ #include <fcntl.h> #include "afb-wsj1.h" +#include "afb-common.h" /**************** WebSocket handshake ****************************/ @@ -111,7 +112,7 @@ static char *strjoin(int count, const char **strings, const char *separ) /* creates the http message for the request */ static int make_request(char **request, const char *path, const char *host, const char *key, const char *protocols) { - int rc = asprintf(request, + int rc = asprintf(request, "GET %s HTTP/1.1\r\n" "Host: %s\r\n" "Upgrade: websocket\r\n" @@ -314,7 +315,7 @@ invalid: errno = EINVAL; error: return -1; - + } @@ -406,4 +407,15 @@ 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(); +} + |