]> git.kaiwu.me - njs.git/commitdiff
Fixed timeouts with Fetch, SSL and select.
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 6 Oct 2021 12:57:14 +0000 (15:57 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 6 Oct 2021 12:57:14 +0000 (15:57 +0300)
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.

nginx/ngx_js_fetch.c

index ce13b8baed166037d279fb26117fe8dd3cc954b0..4795c877126c7c8cbe20a81ca8afeafa3c7a89a4 100644 (file)
@@ -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);