Change-Id: I0fce95b5ff4de8e826ceb4da1bc2ac86f21d70b1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
do {
rc = readv(ws->fd, iov, iovcnt);
} while(rc == -1 && errno == EINTR);
+ if (rc == 0) {
+ errno = EPIPE;
+ rc = -1;
+ }
return rc;
}
static void aws_on_readable(struct afb_ws *ws)
{
- websock_dispatch(ws->ws);
+ if (websock_dispatch(ws->ws) < 0 && errno == EPIPE)
+ afb_ws_disconnect(ws);
}
static void aws_on_hangup(struct afb_ws *ws)