From: Sergey Kandaurov Date: Wed, 6 Oct 2021 12:57:14 +0000 (+0300) Subject: Fixed timeouts with Fetch, SSL and select. X-Git-Tag: 0.7.0~14 X-Git-Url: http://git.kaiwu.me/sitemap.xml?a=commitdiff_plain;h=64c7191237f9cd2ef8e41d0269202a6a111d0feb;p=njs.git Fixed timeouts with Fetch, SSL and select. Similar to the connection hang fixed in 058a67435e83 in nginx, it is possible that an established connection is ready for reading after the handshake. Further, events might be already disabled in case of level-triggered event methods. Fix is to post a read event if the c->read->ready flag is set. --- diff --git a/nginx/ngx_js_fetch.c b/nginx/ngx_js_fetch.c index ce13b8ba..4795c877 100644 --- a/nginx/ngx_js_fetch.c +++ b/nginx/ngx_js_fetch.c @@ -1007,6 +1007,10 @@ ngx_js_http_ssl_handshake(ngx_js_http_t *http) c->write->handler = ngx_js_http_write_handler; c->read->handler = ngx_js_http_read_handler; + if (c->read->ready) { + ngx_post_event(c->read, &ngx_posted_events); + } + http->process = ngx_js_http_process_status_line; ngx_js_http_write_handler(c->write);