[PATCH] SPDY: fix bug that "tcp_nopush off" doesnt work

Xiaochen Wang wangxiaochen0 at gmail.com
Fri Dec 13 05:43:20 UTC 2013


See the patch as following:

# HG changeset patch
# User Xiaochen Wang <wangxiaochen0 at gmail.com>
# Date 1386913049 -28800
# Node ID 9af659c4cf71e668183d6a3e2abe1effb89ced22
# Parent  f6258a7092e4edc24ee084944eda8a460c549970
SPDY: fix bug that "tcp_nopush off" doesnt work

ngx_http_update_location_config() set NGX_TCP_NOPUSH_DISABLED to fake
connection originally.
In such case, ngx_http_spdy_send_output_queue :: c->send_chain() always
sets tcp_nopush for sendfile().

diff -r f6258a7092e4 -r 9af659c4cf71 src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c	Thu Dec 12 20:28:48 2013 +0400
+++ b/src/http/ngx_http_core_module.c	Fri Dec 13 13:37:29 2013 +0800
@@ -1520,6 +1520,13 @@
     if (!clcf->tcp_nopush) {
         /* disable TCP_NOPUSH/TCP_CORK use */
         r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
+
+#if (NGX_HTTP_SPDY)
+        if (r->spdy_stream) {
+            r->spdy_stream->connection->connection->tcp_nopush =
+                                                       NGX_TCP_NOPUSH_DISABLED;
+        }
+#endif
     }
 
     if (r->limit_rate == 0) {
-------------- next part --------------
# HG changeset patch
# User Xiaochen Wang <wangxiaochen0 at gmail.com>
# Date 1386913049 -28800
# Node ID 9af659c4cf71e668183d6a3e2abe1effb89ced22
# Parent  f6258a7092e4edc24ee084944eda8a460c549970
SPDY: fix bug that "tcp_nopush off" doesnt work

ngx_http_update_location_config() set NGX_TCP_NOPUSH_DISABLED to fake
connection originally.
In such case, ngx_http_spdy_send_output_queue :: c->send_chain() always
sets tcp_nopush for sendfile().

diff -r f6258a7092e4 -r 9af659c4cf71 src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c	Thu Dec 12 20:28:48 2013 +0400
+++ b/src/http/ngx_http_core_module.c	Fri Dec 13 13:37:29 2013 +0800
@@ -1520,6 +1520,13 @@
     if (!clcf->tcp_nopush) {
         /* disable TCP_NOPUSH/TCP_CORK use */
         r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
+
+#if (NGX_HTTP_SPDY)
+        if (r->spdy_stream) {
+            r->spdy_stream->connection->connection->tcp_nopush =
+                                                       NGX_TCP_NOPUSH_DISABLED;
+        }
+#endif
     }
 
     if (r->limit_rate == 0) {


More information about the nginx-devel mailing list