aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2020-09-16 18:26:24 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2020-09-16 18:26:24 +0300
commitf6c28f93aff7caad3c178d4989b73a6ed3281bcd (patch)
tree5e602de6b664f71aaccd4a9c155b580a9be72d63 /src
parenta1864c25861c8cb0b972815e4cbafcf227c4f8cb (diff)
downloadnginx-f6c28f93aff7caad3c178d4989b73a6ed3281bcd.tar.gz
nginx-f6c28f93aff7caad3c178d4989b73a6ed3281bcd.zip
SSL: disabled shutdown after connection errors.
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 sending fails in ngx_http_test_expect(), similarly to ticket #1194. Note that there are some places where c->error is misused to prevent further output, such as ngx_http_v2_finalize_connection() if there are pending streams, or in filter finalization. These places seem to be extreme enough to don't care about missing shutdown though. For example, filter finalization currently prevents keepalive from being used.
Diffstat (limited to 'src')
-rw-r--r--src/event/ngx_event_openssl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index 2f51b133a..16dc55382 100644
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -2805,7 +2805,7 @@ ngx_ssl_shutdown(ngx_connection_t *c)
return NGX_OK;
}
- if (c->timedout) {
+ if (c->timedout || c->error) {
mode = SSL_RECEIVED_SHUTDOWN|SSL_SENT_SHUTDOWN;
SSL_set_quiet_shutdown(c->ssl->connection, 1);