# HG changeset patch # User Maxim Dounin # Date 1714231285 -10800 # Node ID c9550e77186caecff6ae146dedd216fc9558652b # Parent 0748264a12780dc9464ccbed2efb3c9efd590be9 Request body: simplified error handling in HTTP/2. No functional changes. diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -4238,11 +4238,7 @@ ngx_http_v2_read_client_request_body_han if (window < stream->recv_window) { ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, "http2 negative window update"); - - stream->skip_data = 1; - - ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - return; + goto error; } return; @@ -4252,18 +4248,24 @@ ngx_http_v2_read_client_request_body_han window - stream->recv_window) == NGX_ERROR) { - stream->skip_data = 1; - ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - return; + goto error; } stream->recv_window = window; if (ngx_http_v2_send_output_queue(h2c) == NGX_ERROR) { - stream->skip_data = 1; - ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - return; - } + goto error; + } + + return; + +error: + + stream->skip_data = 1; + + ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); + return; + }