summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-05-18 10:05:01 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-05-18 10:05:01 +0200
commitb4d45c6cbdd3d98706e16303dd7c55a0a0713a1f (patch)
tree93d202d187dfaeb1f51992ba83787af2289e5106
parente52a48e88d80303e8d857f6757e60a5839d64e0f (diff)
fix bug in websocket client
Change-Id: I45c44f31c02ac81dc41127fe35024a57b8d4be33 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-ws-client.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/afb-ws-client.c b/src/afb-ws-client.c
index 2569d135..32f8778e 100644
--- a/src/afb-ws-client.c
+++ b/src/afb-ws-client.c
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
+#include <fcntl.h>
#include "afb-wsj1.h"
@@ -365,8 +366,10 @@ struct afb_wsj1 *afb_ws_client_connect_wsj1(const char *uri, struct afb_wsj1_itf
rc = negociate(fd, proto_json1, path, xhost);
if (rc == 0) {
result = afb_wsj1_create(fd, itf, closure);
- if (result != NULL)
+ if (result != NULL) {
+ fcntl(fd, F_SETFL, O_NONBLOCK);
break;
+ }
}
}
close(fd);