about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-27 00:24:48 -0400
committerJune McEnroe <june@causal.agency>2019-10-27 00:24:48 -0400
commit8b8e2b5165e171e75d2299115f89057f25322a68 (patch)
tree38d18adb3d6840ca2b987cc047d4f4484f9b22ac
parentExplicitly tls_handshake new clients (diff)
downloadpounce-8b8e2b5165e171e75d2299115f89057f25322a68.tar.gz
pounce-8b8e2b5165e171e75d2299115f89057f25322a68.zip
Drop clients on zero-length reads
Diffstat (limited to '')
-rw-r--r--client.c4
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;
 	}