]> git.kaiwu.me - nginx.git/commitdiff
Fixed handling of the ready flag with kqueue.
authorValentin Bartenev <vbart@nginx.com>
Thu, 5 Sep 2013 12:53:02 +0000 (16:53 +0400)
committerValentin Bartenev <vbart@nginx.com>
Thu, 5 Sep 2013 12:53:02 +0000 (16:53 +0400)
There is nothing to do more when recv() has returned 0,
so we should drop the flag.

src/os/unix/ngx_readv_chain.c
src/os/unix/ngx_recv.c

index c2c21b4077f520cc2e00ef8092c883cdce37cbd3..8836c817dad0e7831b20e3251c7260e7e336e9f2 100644 (file)
@@ -129,6 +129,7 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
                                   "%d available bytes", rev->available);
 #endif
 
+                    rev->ready = 0;
                     rev->eof = 1;
                     rev->available = 0;
                 }
index 1640cdb27219882d26bcf747602defd567cf36f8..86675dfdd8fe194c9aadfab7c180d895916305bb 100644 (file)
@@ -80,6 +80,7 @@ ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
                      * even if kqueue reported about available data
                      */
 
+                    rev->ready = 0;
                     rev->eof = 1;
                     rev->available = 0;
                 }