diff options
author | June McEnroe <june@causal.agency> | 2019-12-22 16:56:22 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-12-22 16:56:22 -0500 |
commit | ba7e76f2cee6e1ee6c7eb1709370a1fbddea50a1 (patch) | |
tree | a7e3db21076fd234af2ff37739a81d741631563c /server.c | |
parent | Revert "Exit when server gets POLLHUP" (diff) | |
download | pounce-ba7e76f2cee6e1ee6c7eb1709370a1fbddea50a1.tar.gz pounce-ba7e76f2cee6e1ee6c7eb1709370a1fbddea50a1.zip |
Exit on zero-length server read
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/server.c b/server.c index 80d34df..ce5ae87 100644 --- a/server.c +++ b/server.c @@ -130,6 +130,7 @@ void serverRecv(void) { ssize_t read = tls_read(client, &buf[len], sizeof(buf) - len); if (read == TLS_WANT_POLLIN || read == TLS_WANT_POLLOUT) return; if (read < 0) errx(EX_IOERR, "server tls_read: %s", tls_error(client)); + if (!read) errx(EX_PROTOCOL, "server closed connection"); len += read; char *crlf; |