]> git.kaiwu.me - nginx.git/commitdiff
SSL: disabled shutdown when there are buffered data.
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 16 Sep 2020 15:26:25 +0000 (18:26 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 16 Sep 2020 15:26:25 +0000 (18:26 +0300)
This fixes "SSL_shutdown() failed (SSL: ... bad write retry)" errors
as observed on the second SSL_shutdown() call after SSL shutdown fixes in
09fb2135a589 (1.19.2), notably when HTTP/2 connections are closed due
to read timeouts while there are incomplete writes.

src/event/ngx_event_openssl.c

index 16dc553829bfecd3f0ba1ed6ccecbae481435a5d..da37b71df4618c0e8559a88cc1539b6491b5a527 100644 (file)
@@ -2805,7 +2805,7 @@ ngx_ssl_shutdown(ngx_connection_t *c)
         return NGX_OK;
     }
 
-    if (c->timedout || c->error) {
+    if (c->timedout || c->error || c->buffered) {
         mode = SSL_RECEIVED_SHUTDOWN|SSL_SENT_SHUTDOWN;
         SSL_set_quiet_shutdown(c->ssl->connection, 1);