]> git.kaiwu.me - nginx.git/commitdiff
Write filter: stored delay in a variable, no functional changes.
authorRoman Arutyunyan <arut@nginx.com>
Tue, 28 Oct 2014 09:29:59 +0000 (12:29 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Tue, 28 Oct 2014 09:29:59 +0000 (12:29 +0300)
The code is now similar to ngx_event_pipe_read_upstream().

src/http/ngx_http_write_filter_module.c

index 83cb1fa1e9857acdf7b4eab7b3bc2ddbf5bd8240..b19f75bda37c64c8101491b2974ad49e2a41f253 100644 (file)
@@ -219,8 +219,8 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
 
         if (limit <= 0) {
             c->write->delayed = 1;
-            ngx_add_timer(c->write,
-                          (ngx_msec_t) (- limit * 1000 / r->limit_rate + 1));
+            delay = (ngx_msec_t) (- limit * 1000 / r->limit_rate + 1);
+            ngx_add_timer(c->write, delay);
 
             c->buffered |= NGX_HTTP_WRITE_BUFFERED;