Welcome! Log In Create A New Profile

Advanced

[nginx] SSL: reset ready flag if recv(MSG_PEEK) found no bytes i...

Roman Arutyunyan
March 02, 2015 01:30PM
details: http://hg.nginx.org/nginx/rev/5b549cc7f698
branches:
changeset: 5993:5b549cc7f698
user: Roman Arutyunyan <arut@nginx.com>
date: Mon Mar 02 21:15:46 2015 +0300
description:
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:

src/http/ngx_http_request.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r 174512857ccf -r 5b549cc7f698 src/http/ngx_http_request.c
--- a/src/http/ngx_http_request.c Mon Mar 02 19:47:13 2015 +0300
+++ b/src/http/ngx_http_request.c Mon Mar 02 21:15:46 2015 +0300
@@ -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);

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] SSL: reset ready flag if recv(MSG_PEEK) found no bytes i...

Roman Arutyunyan 879 March 02, 2015 01:30PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 303
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready