mirror of
https://github.com/nginx/nginx.git
synced 2024-12-26 08:51:03 -06:00
SSL: fixed event handling during shutdown.
The c->read->ready and c->write->ready flags need to be cleared to ensure that appropriate read or write events will be reported by kernel. Without this, SSL shutdown might wait till the timeout after blocking on writing or reading even if there is a socket activity.
This commit is contained in:
parent
82cf625ab5
commit
a1864c2586
@ -2865,6 +2865,13 @@ ngx_ssl_shutdown(ngx_connection_t *c)
|
|||||||
c->read->handler = ngx_ssl_shutdown_handler;
|
c->read->handler = ngx_ssl_shutdown_handler;
|
||||||
c->write->handler = ngx_ssl_shutdown_handler;
|
c->write->handler = ngx_ssl_shutdown_handler;
|
||||||
|
|
||||||
|
if (sslerr == SSL_ERROR_WANT_READ) {
|
||||||
|
c->read->ready = 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
c->write->ready = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
|
if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user