X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-ws.c;h=2ebfbb93d8f5a01acee0fdd7efd27d51e7da8580;hb=84d02312c1946a23751b6eaaeff113ca1025b9b0;hp=66d1e8d153d1642c4d2559f8cc0bd11f808ebfd0;hpb=04b1757467bcb4e287dd1c34d5a21f76705340d6;p=src%2Fapp-framework-binder.git diff --git a/src/afb-ws.c b/src/afb-ws.c index 66d1e8d1..2ebfbb93 100644 --- a/src/afb-ws.c +++ b/src/afb-ws.c @@ -148,12 +148,17 @@ static ssize_t aws_readv(struct afb_ws *ws, const struct iovec *iov, int iovcnt) 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)