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.
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);