]> git.kaiwu.me - nginx.git/commitdiff
Fixed loop in ngx_writev_chain() and ngx_solaris_sendfilev_chain().
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 17 Apr 2012 09:10:50 +0000 (09:10 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 17 Apr 2012 09:10:50 +0000 (09:10 +0000)
The "complete" flag wasn't cleared on loop iteration start, resulting in
broken behaviour if there were more than IOV_MAX buffers and first
iteration was fully completed (and hence the "complete" flag was set
to 1).

src/os/unix/ngx_solaris_sendfilev_chain.c
src/os/unix/ngx_writev_chain.c

index d68220dc32f19633cc1f0415617591f203ebe018..64e59aa2efb7d9782cf52a41450c02132bf6593c 100644 (file)
@@ -74,7 +74,6 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
 
 
     send = 0;
-    complete = 0;
 
     vec.elts = sfvs;
     vec.size = sizeof(sendfilevec_t);
@@ -87,6 +86,7 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
         fprev = 0;
         sfv = NULL;
         eintr = 0;
+        complete = 0;
         sent = 0;
         prev_send = send;
 
index 579fdecc89742d6b45a9abb99d55aa2338b2aab3..a752b1f916fbc4e2dee7b0413a759e3519d08b4f 100644 (file)
@@ -54,7 +54,6 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
     }
 
     send = 0;
-    complete = 0;
 
     vec.elts = iovs;
     vec.size = sizeof(struct iovec);
@@ -65,6 +64,7 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
         prev = NULL;
         iov = NULL;
         eintr = 0;
+        complete = 0;
         prev_send = send;
 
         vec.nelts = 0;