[nginx] Reduced difference between the send chain functions.

Valentin Bartenev vbart at nginx.com
Sun Sep 21 11:35:21 UTC 2014


details:   http://hg.nginx.org/nginx/rev/a6e83ac70af9
branches:  
changeset: 5853:a6e83ac70af9
user:      Valentin Bartenev <vbart at nginx.com>
date:      Wed Aug 13 15:11:45 2014 +0400
description:
Reduced difference between the send chain functions.

No functional changes.  This follows the change from ad137a80919f.

diffstat:

 src/os/unix/ngx_writev_chain.c   |  10 ++++------
 src/os/win32/ngx_wsasend_chain.c |  16 +++++++---------
 2 files changed, 11 insertions(+), 15 deletions(-)

diffs (73 lines):

diff -r 43512a33e8f2 -r a6e83ac70af9 src/os/unix/ngx_writev_chain.c
--- a/src/os/unix/ngx_writev_chain.c	Wed Aug 13 15:11:45 2014 +0400
+++ b/src/os/unix/ngx_writev_chain.c	Wed Aug 13 15:11:45 2014 +0400
@@ -138,7 +138,7 @@ ngx_writev_chain(ngx_connection_t *c, ng
 
         c->sent += sent;
 
-        cl = ngx_handle_sent_chain(in, sent);
+        in = ngx_handle_sent_chain(in, sent);
 
         if (eintr) {
             continue;
@@ -146,13 +146,11 @@ ngx_writev_chain(ngx_connection_t *c, ng
 
         if (send - prev_send != sent) {
             wev->ready = 0;
-            return cl;
+            return in;
         }
 
-        if (send >= limit || cl == NULL) {
-            return cl;
+        if (send >= limit || in == NULL) {
+            return in;
         }
-
-        in = cl;
     }
 }
diff -r 43512a33e8f2 -r a6e83ac70af9 src/os/win32/ngx_wsasend_chain.c
--- a/src/os/win32/ngx_wsasend_chain.c	Wed Aug 13 15:11:45 2014 +0400
+++ b/src/os/win32/ngx_wsasend_chain.c	Wed Aug 13 15:11:45 2014 +0400
@@ -113,18 +113,16 @@ ngx_wsasend_chain(ngx_connection_t *c, n
 
         c->sent += sent;
 
-        cl = ngx_handle_sent_chain(in, sent);
+        in = ngx_handle_sent_chain(in, sent);
 
         if (send - prev_send != sent) {
             wev->ready = 0;
-            return cl;
+            return in;
         }
 
-        if (send >= limit || cl == NULL) {
-            return cl;
+        if (send >= limit || in == NULL) {
+            return in;
         }
-
-        in = cl;
     }
 }
 
@@ -280,14 +278,14 @@ ngx_overlapped_wsasend_chain(ngx_connect
 
     c->sent += sent;
 
-    cl = ngx_handle_sent_chain(in, sent);
+    in = ngx_handle_sent_chain(in, sent);
 
-    if (cl) {
+    if (in) {
         wev->ready = 0;
 
     } else {
         wev->ready = 1;
     }
 
-    return cl;
+    return in;
 }



More information about the nginx-devel mailing list