comparison src/http/v2/ngx_http_v2.c @ 6280:16905ecbb49e

HTTP/2: simplified checking the END_STREAM flag. No functional changes.
author Valentin Bartenev <vbart@nginx.com>
date Mon, 26 Oct 2015 17:46:28 +0300
parents 60f916da7294
children 66ee1c5cb6aa
comparison
equal deleted inserted replaced
6279:c72eaf694d99 6280:16905ecbb49e
868 } 868 }
869 869
870 return ngx_http_v2_state_skip_padded(h2c, pos, end); 870 return ngx_http_v2_state_skip_padded(h2c, pos, end);
871 } 871 }
872 872
873 stream->in_closed = h2c->state.flags & NGX_HTTP_V2_END_STREAM_FLAG;
874
873 h2c->state.stream = stream; 875 h2c->state.stream = stream;
874 876
875 return ngx_http_v2_state_read_data(h2c, pos, end); 877 return ngx_http_v2_state_read_data(h2c, pos, end);
876 } 878 }
877 879
895 if (stream == NULL) { 897 if (stream == NULL) {
896 return ngx_http_v2_state_skip_padded(h2c, pos, end); 898 return ngx_http_v2_state_skip_padded(h2c, pos, end);
897 } 899 }
898 900
899 if (stream->skip_data) { 901 if (stream->skip_data) {
900 stream->in_closed = h2c->state.flags & NGX_HTTP_V2_END_STREAM_FLAG;
901
902 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0, 902 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
903 "skipping http2 DATA frame, reason: %d", 903 "skipping http2 DATA frame, reason: %d",
904 stream->skip_data); 904 stream->skip_data);
905 905
906 return ngx_http_v2_state_skip_padded(h2c, pos, end); 906 return ngx_http_v2_state_skip_padded(h2c, pos, end);
986 if (h2c->state.length) { 986 if (h2c->state.length) {
987 return ngx_http_v2_state_save(h2c, pos, end, 987 return ngx_http_v2_state_save(h2c, pos, end,
988 ngx_http_v2_state_read_data); 988 ngx_http_v2_state_read_data);
989 } 989 }
990 990
991 if (h2c->state.flags & NGX_HTTP_V2_END_STREAM_FLAG) { 991 if (stream->in_closed) {
992 stream->in_closed = 1;
993
994 if (r->headers_in.content_length_n < 0) { 992 if (r->headers_in.content_length_n < 0) {
995 r->headers_in.content_length_n = rb->rest; 993 r->headers_in.content_length_n = rb->rest;
996 994
997 } else if (r->headers_in.content_length_n != rb->rest) { 995 } else if (r->headers_in.content_length_n != rb->rest) {
998 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, 996 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,