diff options
author | June McEnroe <june@causal.agency> | 2019-10-27 00:24:48 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-10-27 00:24:48 -0400 |
commit | 8b8e2b5165e171e75d2299115f89057f25322a68 (patch) | |
tree | 38d18adb3d6840ca2b987cc047d4f4484f9b22ac | |
parent | Explicitly tls_handshake new clients (diff) | |
download | pounce-8b8e2b5165e171e75d2299115f89057f25322a68.tar.gz pounce-8b8e2b5165e171e75d2299115f89057f25322a68.zip |
Drop clients on zero-length reads
-rw-r--r-- | client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client.c b/client.c index 198f1f6..7aa2584 100644 --- a/client.c +++ b/client.c @@ -225,8 +225,8 @@ void clientRecv(struct Client *client) { &client->buf[client->len], sizeof(client->buf) - client->len ); if (read == TLS_WANT_POLLIN || read == TLS_WANT_POLLOUT) return; - if (read < 0) { - warnx("tls_read: %s", tls_error(client->tls)); + if (read <= 0) { + if (read < 0) warnx("tls_read: %s", tls_error(client->tls)); client->error = true; return; } |