This commit is contained in:
Srujan rai 2026-05-22 20:25:15 +05:30 committed by GitHub
commit 413a0ff7ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View file

@ -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;

View file

@ -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