diff options
author | Valentin Bartenev <vbart@nginx.com> | 2015-10-26 17:46:28 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2015-10-26 17:46:28 +0300 |
commit | f36f51725a806c720f012f34f57e66395343d653 (patch) | |
tree | cf1db6243040bd34aa6f6c26ca83e8b8869bc281 | |
parent | d418b92cdcc869c39eff75d90e62182352d6978e (diff) |
HTTP/2: simplified checking the END_STREAM flag.
No functional changes.
-rw-r--r-- | src/http/v2/ngx_http_v2.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c index 32da12f5..10cb727f 100644 --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -870,6 +870,8 @@ ngx_http_v2_state_data(ngx_http_v2_connection_t *h2c, u_char *pos, u_char *end) return ngx_http_v2_state_skip_padded(h2c, pos, end); } + stream->in_closed = h2c->state.flags & NGX_HTTP_V2_END_STREAM_FLAG; + h2c->state.stream = stream; return ngx_http_v2_state_read_data(h2c, pos, end); @@ -897,8 +899,6 @@ ngx_http_v2_state_read_data(ngx_http_v2_connection_t *h2c, u_char *pos, } if (stream->skip_data) { - stream->in_closed = h2c->state.flags & NGX_HTTP_V2_END_STREAM_FLAG; - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0, "skipping http2 DATA frame, reason: %d", stream->skip_data); @@ -988,9 +988,7 @@ ngx_http_v2_state_read_data(ngx_http_v2_connection_t *h2c, u_char *pos, ngx_http_v2_state_read_data); } - if (h2c->state.flags & NGX_HTTP_V2_END_STREAM_FLAG) { - stream->in_closed = 1; - + if (stream->in_closed) { if (r->headers_in.content_length_n < 0) { r->headers_in.content_length_n = rb->rest; |