From e96ff3209313aa7ff7a02434859cfa8fb9143405 Mon Sep 17 00:00:00 2001 From: Oknet Xu Date: Wed, 1 Nov 2017 15:33:04 +0800 Subject: [PATCH] Treat SSL_ERROR_SSL as EPIPE within SSLNetVC::load_buffer_and_write() Compare to the SSLNetVC::ssl_read_from_net, it return `SSL_READ_ERROR` if sslErr is `SSL_ERROR_SSL`, but the SSLNetVC::load_buffer_and_write does not change the result (num_really_written). This closes #2705 --- iocore/net/SSLNetVConnection.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc index 7055c1f4f7a..fbb48c83bfe 100644 --- a/iocore/net/SSLNetVConnection.cc +++ b/iocore/net/SSLNetVConnection.cc @@ -797,7 +797,8 @@ SSLNetVConnection::load_buffer_and_write(int64_t towrite, MIOBufferAccessor &buf ERR_error_string_n(e, buf, sizeof(buf)); TraceIn(trace, get_remote_addr(), get_remote_port(), "SSL Error: sslErr=%d, ERR_get_error=%ld (%s) errno=%d", err, e, buf, errno); - num_really_written = -errno; + // Treat SSL_ERROR_SSL as EPIPE error. + num_really_written = -EPIPE; SSL_CLR_ERR_INCR_DYN_STAT(this, ssl_error_ssl, "SSL_write-SSL_ERROR_SSL errno=%d", errno); } break; }