diff options
author | Roman Arutyunyan <arut@nginx.com> | 2015-03-02 21:15:46 +0300 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2015-03-02 21:15:46 +0300 |
commit | 46a2236f226d7a68a6e830b8fd2c618c12bf4ca9 (patch) | |
tree | 7a7767a0635b722c9a9dfc3f2b95644dadc55630 /src/http/ngx_http_request.c | |
parent | f0b5f833780b5a27f607f18fef56b047f6ffead1 (diff) | |
download | nginx-46a2236f226d7a68a6e830b8fd2c618c12bf4ca9.tar.gz nginx-46a2236f226d7a68a6e830b8fd2c618c12bf4ca9.zip |
SSL: reset ready flag if recv(MSG_PEEK) found no bytes in socket.
Previously, connection hung after calling ngx_http_ssl_handshake() with
rev->ready set and no bytes in socket to read. It's possible in at least the
following cases:
- when processing a connection with expired TCP_DEFER_ACCEPT on Linux
- after parsing PROXY protocol header if it arrived in a separate TCP packet
Thanks to James Hamlin.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index a07d5e47f..0ee145dd6 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -652,6 +652,7 @@ ngx_http_ssl_handshake(ngx_event_t *rev) if (n == -1) { if (err == NGX_EAGAIN) { + rev->ready = 0; if (!rev->timer_set) { ngx_add_timer(rev, c->listening->post_accept_timeout); |