From: Emeric Brun Date: Fri, 14 Dec 2012 11:33:41 +0000 (+0100) Subject: BUG/MINOR: ssl: error is not reported if it occurs simultaneously with peer close... X-Git-Tag: v1.5-dev16~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c646867881894c5f3c81b0eb5d928ce1cca5b82;p=thirdparty%2Fhaproxy.git BUG/MINOR: ssl: error is not reported if it occurs simultaneously with peer close detection. --- diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 7415b754a5..99f22f6839 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -1078,6 +1078,11 @@ static int ssl_sock_to_buf(struct connection *conn, struct buffer *buf, int coun else if (ret == 0) { ret = SSL_get_error(conn->xprt_ctx, ret); if (ret != SSL_ERROR_ZERO_RETURN) { + /* error on protocol or underlying transport */ + if ((ret != SSL_ERROR_SYSCALL) + || (errno && (errno != EAGAIN))) + conn->flags |= CO_FL_ERROR; + /* Clear openssl global errors stack */ ERR_clear_error(); }