Mercurial > hg > nginx
changeset 7751:7efae6b4cfb0
SSL: fixed SSL shutdown on lingering close.
Ensure c->recv is properly reset to ngx_recv if SSL_shutdown()
blocks on writing.
The bug had appeared in 554c6ae25ffc.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 08 Dec 2020 01:43:36 +0300 |
parents | 90cc7194e993 |
children | 8989fbd2f89a |
files | src/event/ngx_event_openssl.c src/http/ngx_http_request.c src/http/v2/ngx_http_v2.c |
diffstat | 3 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/event/ngx_event_openssl.c Fri Nov 27 00:01:20 2020 +0300 +++ b/src/event/ngx_event_openssl.c Tue Dec 08 01:43:36 2020 +0300 @@ -2880,6 +2880,7 @@ SSL_free(c->ssl->connection); c->ssl = NULL; + c->recv = ngx_recv; return NGX_OK; } @@ -2925,6 +2926,7 @@ if (n == 1) { SSL_free(c->ssl->connection); c->ssl = NULL; + c->recv = ngx_recv; return NGX_OK; } @@ -2967,6 +2969,7 @@ if (sslerr == SSL_ERROR_ZERO_RETURN || ERR_peek_error() == 0) { SSL_free(c->ssl->connection); c->ssl = NULL; + c->recv = ngx_recv; return NGX_OK; } @@ -2977,6 +2980,7 @@ SSL_free(c->ssl->connection); c->ssl = NULL; + c->recv = ngx_recv; return NGX_ERROR; }