nginx-0.6.25

Igor Sysoev is at rambler-co.ru
Tue Jan 8 23:40:38 MSK 2008


On Tue, Jan 08, 2008 at 01:09:55PM -0500, Ben Maurer wrote:

> Igor Sysoev wrote:
> >Changes with nginx 0.6.25                                        08 Jan 
> >2008
> >    *) Bugfix: socket leak in HTTPS mode if deferred accept was used.
> >       Thanks to Ben Maurer.
> 
> I don't think the patch that's in 0.6.25 actually fixes the deferred 
> accept issue. That issue caused the MSG_PEEK recv to return an EAGAIN 
> which resulted in read and write events not being handled on that 
> socket. The patch currently in the tree only fixes the issue where the 
> user completes the first half of the handshake but then stops responding.

Yes, you are right. The attached patch should fix this case.

> Also, is there any reason this isn't merged into 0.5.x?

It will be merged after some time (about month).


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/http/ngx_http_request.c
===================================================================
--- src/http/ngx_http_request.c	(revision 1158)
+++ src/http/ngx_http_request.c	(working copy)
@@ -479,6 +479,11 @@
     n = recv(c->fd, (char *) buf, 1, MSG_PEEK);
 
     if (n == -1 && ngx_socket_errno == NGX_EAGAIN) {
+
+        if (!rev->timer_set) {
+            ngx_add_timer(rev, c->listening->post_accept_timeout);
+        }
+
         return;
     }
 


More information about the nginx mailing list