[nginx] Simplified ngx_unix_recv() and ngx_readv_chain().

Valentin Bartenev vbart at nginx.com
Fri Apr 8 13:49:50 UTC 2016


details:   http://hg.nginx.org/nginx/rev/151fd02a4317
branches:  
changeset: 6508:151fd02a4317
user:      Ruslan Ermilov <ru at nginx.com>
date:      Fri Apr 08 16:49:35 2016 +0300
description:
Simplified ngx_unix_recv() and ngx_readv_chain().

This makes ngx_unix_recv() and ngx_udp_unix_recv() differ minimally.

diffstat:

 src/os/unix/ngx_readv_chain.c |  4 +---
 src/os/unix/ngx_recv.c        |  4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diffs (28 lines):

diff -r 8ee94ecd3a50 -r 151fd02a4317 src/os/unix/ngx_readv_chain.c
--- a/src/os/unix/ngx_readv_chain.c	Fri Apr 08 16:41:45 2016 +0300
+++ b/src/os/unix/ngx_readv_chain.c	Fri Apr 08 16:49:35 2016 +0300
@@ -143,9 +143,7 @@ ngx_readv_chain(ngx_connection_t *c, ngx
                         rev->ready = 0;
                     }
 
-                    if (rev->available < 0) {
-                        rev->available = 0;
-                    }
+                    rev->available = 0;
                 }
 
                 return n;
diff -r 8ee94ecd3a50 -r 151fd02a4317 src/os/unix/ngx_recv.c
--- a/src/os/unix/ngx_recv.c	Fri Apr 08 16:41:45 2016 +0300
+++ b/src/os/unix/ngx_recv.c	Fri Apr 08 16:49:35 2016 +0300
@@ -93,9 +93,7 @@ ngx_unix_recv(ngx_connection_t *c, u_cha
                         rev->ready = 0;
                     }
 
-                    if (rev->available < 0) {
-                        rev->available = 0;
-                    }
+                    rev->available = 0;
                 }
 
                 return n;



More information about the nginx-devel mailing list