aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-api-ws.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-08-20 12:32:02 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2019-08-20 19:29:12 +0200
commit248f6eafa20476014f4bf12d90b2234c4be7eef2 (patch)
treecc4d2235e985f354e2b4cf0550cdf6a17f1ecb53 /src/afb-api-ws.c
parent0abe8de32bef957b2f72eee7c7eb30c3a9a9efeb (diff)
Fix client disconnection closeguppy_7.0.4guppy/7.0.47.0.4guppy
Before that change, the client disconection made a loop on read but wasn't closing the link. Bug-AGL: SPEC-2759 Signed-off-by: José Bollo <jose.bollo@iot.bzh> Change-Id: Iecfbb95cb1b7079e695ff5c08155b2310bf4b8d8
Diffstat (limited to 'src/afb-api-ws.c')
-rw-r--r--src/afb-api-ws.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/afb-api-ws.c b/src/afb-api-ws.c
index dc45edbb..cf1f3921 100644
--- a/src/afb-api-ws.c
+++ b/src/afb-api-ws.c
@@ -144,10 +144,10 @@ static void api_ws_server_listen_callback(void *closure, uint32_t revents, struc
{
struct api_ws_server *apiws = closure;
- if ((revents & EPOLLIN) != 0)
- api_ws_server_accept(apiws);
- else if ((revents & EPOLLHUP) != 0)
+ if ((revents & EPOLLHUP) != 0)
api_ws_server_connect(apiws);
+ else if ((revents & EPOLLIN) != 0)
+ api_ws_server_accept(apiws);
}
static void api_ws_server_disconnect(struct api_ws_server *apiws)