]> git.kaiwu.me - nginx.git/commitdiff
Upstream: reading from a client after connection upgrade.
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 22 Jan 2014 12:05:07 +0000 (16:05 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 22 Jan 2014 12:05:07 +0000 (16:05 +0400)
Read event on a client connection might have been disabled during
previous processing, and we at least need to handle events.  Calling
ngx_http_upstream_process_upgraded() is a simpliest way to do it.

Notably this change is needed for select, poll and /dev/poll event
methods.

Previous version of this patch was posted here:
http://mailman.nginx.org/pipermail/nginx/2014-January/041839.html

src/http/ngx_http_upstream.c

index b6504d325445b55dcb0c1c65762e466b37c571f3..0524144f22b9b33da65445b0181178aed77e5734 100644 (file)
@@ -2560,11 +2560,7 @@ ngx_http_upstream_upgrade(ngx_http_request_t *r, ngx_http_upstream_t *u)
         ngx_http_upstream_process_upgraded(r, 1, 1);
     }
 
-    if (c->read->ready
-        || r->header_in->pos != r->header_in->last)
-    {
-        ngx_http_upstream_process_upgraded(r, 0, 1);
-    }
+    ngx_http_upstream_process_upgraded(r, 0, 1);
 }