]> git.kaiwu.me - nginx.git/commitdiff
SPDY: avoid setting timeout on stream events in ngx_http_writer().
authorValentin Bartenev <vbart@nginx.com>
Wed, 27 Aug 2014 16:44:11 +0000 (20:44 +0400)
committerValentin Bartenev <vbart@nginx.com>
Wed, 27 Aug 2014 16:44:11 +0000 (20:44 +0400)
The SPDY module doesn't expect timers can be set on stream events for reasons
other than delaying output.  But ngx_http_writer() could add timer on write
event if the delayed flag wasn't set and nginx is waiting for AIO completion.
That could cause delays in sending response over SPDY when file AIO was used.

src/http/ngx_http_request.c

index 845ada322e32e31c4fa7661877dc424a4e3770db..2b932dee436c9ec825efa7c27932909546399e6a 100644 (file)
@@ -2656,6 +2656,12 @@ ngx_http_writer(ngx_http_request_t *r)
 
     if (r->buffered || r->postponed || (r == r->main && c->buffered)) {
 
+#if (NGX_HTTP_SPDY)
+        if (r->spdy_stream) {
+            return;
+        }
+#endif
+
         if (!wev->delayed) {
             ngx_add_timer(wev, clcf->send_timeout);
         }