[PATCH][bugfix] Upstream: clear the delayed flag to prevent blocking from sending.

胡聪 (hucc) hucong.c at foxmail.com
Mon Apr 3 08:02:07 UTC 2017


Hi,

On Sunday, Apr 2, 2017 9:35 PM +0300, Maxim Dounin wrote:

>On Fri, Feb 17, 2017 at 11:18:48AM +0800, 胡聪 (hucc) wrote:
>
>> Hi,
>>
>> To reproduce the scene of send blocking, there must be more than
>> two subrequests, and the more the better.
>>
>
>Thank you for your report.
>
>After looking into this for a while, I've committed several
>patches to fix various issues with wev->delayed:
>
>http://hg.nginx.org/nginx/rev/7fcf209d40c8
>http://hg.nginx.org/nginx/rev/1c5e5e5b008d
>http://hg.nginx.org/nginx/rev/903fb1ddc07f

After looked at these patches, I confirmed that the problem I encountered should
be solved. Thanks for the great solution.

At the same time, I noticed that the type of rc is int not ngx_int_t in
ngx_http_writer(). The type should be ngx_int_t, right? There was a time the
return type of ngx_http_writer() is int. Later, it became void. Since then there
is no need to do type conversion.

# HG changeset patch
# User hucongcong <hucong.c at foxmail.com>
# Date 1491200980 -28800
#      Mon Apr 03 14:29:40 2017 +0800
# Node ID 7c3a0b951d0209612fb50a48abcb10c6ceffbff7
# Parent  903fb1ddc07f6b4345d88428898d95aadfc0223f
fix type

diff -r 903fb1ddc07f -r 7c3a0b951d02 src/http/ngx_http_request.c
--- a/src/http/ngx_http_request.c	Sun Apr 02 14:32:29 2017 +0300
+++ b/src/http/ngx_http_request.c	Mon Apr 03 14:29:40 2017 +0800
@@ -2612,7 +2612,7 @@ ngx_http_set_write_handler(ngx_http_requ
 static void
 ngx_http_writer(ngx_http_request_t *r)
 {
-    int                        rc;
+    ngx_int_t                  rc;
     ngx_event_t               *wev;
     ngx_connection_t          *c;
     ngx_http_core_loc_conf_t  *clcf;
@@ -2652,7 +2652,7 @@ ngx_http_writer(ngx_http_request_t *r)
     rc = ngx_http_output_filter(r, NULL);

     ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0,
-                   "http writer output filter: %d, \"%V?%V\"",
+                   "http writer output filter: %i, \"%V?%V\"",
                    rc, &r->uri, &r->args);

     if (rc == NGX_ERROR) {


More information about the nginx-devel mailing list