[nginx] Fixed checking ngx_tcp_push() and ngx_tcp_nopush() return values.

Ruslan Ermilov ru at nginx.com
Mon Mar 19 13:28:59 UTC 2018


details:   http://hg.nginx.org/nginx/rev/400a3412b1e3
branches:  
changeset: 7239:400a3412b1e3
user:      Ruslan Ermilov <ru at nginx.com>
date:      Mon Mar 19 16:28:23 2018 +0300
description:
Fixed checking ngx_tcp_push() and ngx_tcp_nopush() return values.

No functional changes.

diffstat:

 src/http/ngx_http_upstream.c             |  2 +-
 src/os/unix/ngx_freebsd_sendfile_chain.c |  2 +-
 src/os/unix/ngx_linux_sendfile_chain.c   |  2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 06cf0c4b8618 -r 400a3412b1e3 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c	Mon Mar 19 16:22:09 2018 +0300
+++ b/src/http/ngx_http_upstream.c	Mon Mar 19 16:28:23 2018 +0300
@@ -2020,7 +2020,7 @@ ngx_http_upstream_send_request(ngx_http_
     }
 
     if (c->tcp_nopush == NGX_TCP_NOPUSH_SET) {
-        if (ngx_tcp_push(c->fd) == NGX_ERROR) {
+        if (ngx_tcp_push(c->fd) == -1) {
             ngx_log_error(NGX_LOG_CRIT, c->log, ngx_socket_errno,
                           ngx_tcp_push_n " failed");
             ngx_http_upstream_finalize_request(r, u,
diff -r 06cf0c4b8618 -r 400a3412b1e3 src/os/unix/ngx_freebsd_sendfile_chain.c
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c	Mon Mar 19 16:22:09 2018 +0300
+++ b/src/os/unix/ngx_freebsd_sendfile_chain.c	Mon Mar 19 16:28:23 2018 +0300
@@ -135,7 +135,7 @@ ngx_freebsd_sendfile_chain(ngx_connectio
             if (ngx_freebsd_use_tcp_nopush
                 && c->tcp_nopush == NGX_TCP_NOPUSH_UNSET)
             {
-                if (ngx_tcp_nopush(c->fd) == NGX_ERROR) {
+                if (ngx_tcp_nopush(c->fd) == -1) {
                     err = ngx_socket_errno;
 
                     /*
diff -r 06cf0c4b8618 -r 400a3412b1e3 src/os/unix/ngx_linux_sendfile_chain.c
--- a/src/os/unix/ngx_linux_sendfile_chain.c	Mon Mar 19 16:22:09 2018 +0300
+++ b/src/os/unix/ngx_linux_sendfile_chain.c	Mon Mar 19 16:28:23 2018 +0300
@@ -130,7 +130,7 @@ ngx_linux_sendfile_chain(ngx_connection_
 
             if (c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) {
 
-                if (ngx_tcp_nopush(c->fd) == NGX_ERROR) {
+                if (ngx_tcp_nopush(c->fd) == -1) {
                     err = ngx_socket_errno;
 
                     /*


More information about the nginx-devel mailing list