From e33e0b1c7c3982ce1f453a1021fa2fcd89613abb Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 1 Jun 2017 17:43:55 +0200 Subject: Don't try to keep reading or report errors if client's kill flag is set --- client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client.c b/client.c index ac73003..2fbc560 100644 --- a/client.c +++ b/client.c @@ -80,6 +80,7 @@ static void client_haveIn(epoll_client_t *client) if (ret < 0 && errno == EINTR) continue; if (ret < 0 && errno == EAGAIN) break; if (ret <= 0) { + if (client->kill) return; printf("[Proxy] Client gone while reading (ret=%d, errno=%d).\n", (int)ret, errno); client->kill = TRUE; return; @@ -88,6 +89,7 @@ static void client_haveIn(epoll_client_t *client) // SSL ret = SSL_read(client->ssl, client->readBuffer + client->rbPos, buflen); if (ret <= 0) { + if (client->kill) return; int err = SSL_get_error(client->ssl, ret); if (SSL_BLOCKED(err)) break; if (err == SSL_ERROR_ZERO_RETURN) { -- cgit v1.2.3-55-g7522