diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index a5cd44dcc..7b77770fc 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -3008,9 +3008,15 @@ ngx_http_set_write_handler(ngx_http_request_t *r) r->http_state = NGX_HTTP_WRITING_REQUEST_STATE; - r->read_event_handler = r->discard_body ? - ngx_http_discarded_request_body_handler: - ngx_http_test_reading; + r->read_event_handler = +#if (NGX_HTTP_V2) + r->stream ? ngx_http_test_reading : +#endif +#if (NGX_HTTP_V3) + r->connection->quic ? ngx_http_test_reading : +#endif + r->discard_body ? ngx_http_discarded_request_body_handler : + ngx_http_test_reading; r->write_event_handler = ngx_http_writer; wev = r->connection->write; diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c index 1d8e4081a..9c26d5211 100644 --- a/src/http/ngx_http_request_body.c +++ b/src/http/ngx_http_request_body.c @@ -642,12 +642,14 @@ ngx_http_discard_request_body(ngx_http_request_t *r) #if (NGX_HTTP_V2) if (r->stream) { r->stream->skip_data = 1; + r->discard_body = 1; return NGX_OK; } #endif #if (NGX_HTTP_V3) if (r->http_version == NGX_HTTP_VERSION_30) { + r->discard_body = 1; return NGX_OK; } #endif