From bd1a974e669c9dc206d56ae2bc768b305fba53d5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 21 Apr 2017 15:04:06 +0200 Subject: client.c: Shutdown SSL connection if peer requests so --- client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client.c b/client.c index 906b718..ac73003 100644 --- a/client.c +++ b/client.c @@ -90,6 +90,10 @@ static void client_haveIn(epoll_client_t *client) if (ret <= 0) { int err = SSL_get_error(client->ssl, ret); if (SSL_BLOCKED(err)) break; + if (err == SSL_ERROR_ZERO_RETURN) { + SSL_shutdown(client->ssl); + // Might have to handle error return codes; need another state in epoll_client_t for this + } printf("[Proxy] SSL client gone while reading (ret=%d, err=%d).\n", (int)ret, err); client->kill = TRUE; return; -- cgit v1.2.3-55-g7522