Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
handles disconnection
[src/app-framework-binder.git]
/
src
/
afb-ws.c
diff --git
a/src/afb-ws.c
b/src/afb-ws.c
index
66d1e8d
..
2ebfbb9
100644
(file)
--- 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);
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)
{
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)
}
static void aws_on_hangup(struct afb_ws *ws)