summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2017-06-01 17:43:55 +0200
committerSimon Rettberg2017-06-01 17:43:55 +0200
commite33e0b1c7c3982ce1f453a1021fa2fcd89613abb (patch)
treea213617c4563d1006cc7e422ddea41dd83fedc71
parentMake print filter function output identical to usual string representation of... (diff)
downloadldadp-e33e0b1c7c3982ce1f453a1021fa2fcd89613abb.tar.gz
ldadp-e33e0b1c7c3982ce1f453a1021fa2fcd89613abb.tar.xz
ldadp-e33e0b1c7c3982ce1f453a1021fa2fcd89613abb.zip
Don't try to keep reading or report errors if client's kill flag is set
-rw-r--r--client.c2
1 files changed, 2 insertions, 0 deletions
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) {