Welcome! Log In Create A New Profile

Advanced

[nginx] SSL: fixed event handling during shutdown.

Maxim Dounin
September 16, 2020 05:42PM
details: https://hg.nginx.org/nginx/rev/adaec579a967
branches:
changeset: 7707:adaec579a967
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed Sep 16 18:26:23 2020 +0300
description:
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.

diffstat:

src/event/ngx_event_openssl.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r 61011bfcdb49 -r adaec579a967 src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c Wed Sep 16 18:26:22 2020 +0300
+++ b/src/event/ngx_event_openssl.c Wed Sep 16 18:26:23 2020 +0300
@@ -2865,6 +2865,13 @@ ngx_ssl_shutdown(ngx_connection_t *c)
c->read->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) {
return NGX_ERROR;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] SSL: fixed event handling during shutdown.

Maxim Dounin 43 September 16, 2020 05:42PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 63
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready