[nginx] HTTP/2: fixed stream finalization.

Valentin Bartenev vbart at nginx.com
Wed Mar 29 17:24:27 UTC 2017


details:   http://hg.nginx.org/nginx/rev/9b5f31fdb850
branches:  
changeset: 6956:9b5f31fdb850
user:      Valentin Bartenev <vbart at nginx.com>
date:      Wed Mar 29 20:16:23 2017 +0300
description:
HTTP/2: fixed stream finalization.

In order to finalize stream the error flag is set on fake connection and
either "write" or "read" event handler is called.  The read events of fake
connections are always ready, but it's not the case with the write events.

When the ready flag isn't set, the error flag can be not checked in some
cases and as a result stream isn't finalized.  Now the ready flag is
explicilty set on write events for proper finalization in all cases.

diffstat:

 src/http/v2/ngx_http_v2.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r d38161da62cd -r 9b5f31fdb850 src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c	Sun Mar 26 01:25:05 2017 -0700
+++ b/src/http/v2/ngx_http_v2.c	Wed Mar 29 20:16:23 2017 +0300
@@ -4266,7 +4266,10 @@ ngx_http_v2_finalize_connection(ngx_http
 
             if (stream->queued) {
                 stream->queued = 0;
+
                 ev = fc->write;
+                ev->active = 0;
+                ev->ready = 1;
 
             } else {
                 ev = fc->read;


More information about the nginx-devel mailing list