mirror of
https://github.com/nginx/nginx.git
synced 2025-06-11 04:12:40 +08:00
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.
This commit is contained in:
parent
cfa669151e
commit
e62a5132ca
@ -2880,6 +2880,7 @@ ngx_ssl_shutdown(ngx_connection_t *c)
|
||||
|
||||
SSL_free(c->ssl->connection);
|
||||
c->ssl = NULL;
|
||||
c->recv = ngx_recv;
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
@ -2925,6 +2926,7 @@ ngx_ssl_shutdown(ngx_connection_t *c)
|
||||
if (n == 1) {
|
||||
SSL_free(c->ssl->connection);
|
||||
c->ssl = NULL;
|
||||
c->recv = ngx_recv;
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
@ -2967,6 +2969,7 @@ ngx_ssl_shutdown(ngx_connection_t *c)
|
||||
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 @@ ngx_ssl_shutdown(ngx_connection_t *c)
|
||||
|
||||
SSL_free(c->ssl->connection);
|
||||
c->ssl = NULL;
|
||||
c->recv = ngx_recv;
|
||||
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
@ -3397,8 +3397,6 @@ ngx_http_set_lingering_close(ngx_connection_t *c)
|
||||
c->ssl->handler = ngx_http_set_lingering_close;
|
||||
return;
|
||||
}
|
||||
|
||||
c->recv = ngx_recv;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -739,8 +739,6 @@ ngx_http_v2_lingering_close(ngx_connection_t *c)
|
||||
c->ssl->handler = ngx_http_v2_lingering_close;
|
||||
return;
|
||||
}
|
||||
|
||||
c->recv = ngx_recv;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user