Welcome! Log In Create A New Profile

Advanced

[nginx] HTTP/2: run posted requests after reading body.

Maxim Dounin
September 23, 2020 02:38PM
details: https://hg.nginx.org/nginx/rev/526dddf637bb
branches:
changeset: 7711:526dddf637bb
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed Sep 23 19:52:31 2020 +0300
description:
HTTP/2: run posted requests after reading body.

HTTP/2 code failed to run posted requests after calling the request body
handler, and this resulted in connection hang if a subrequest was created
in the body handler and no other actions were made.

diffstat:

src/http/v2/ngx_http_v2.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r 097f578a4a8f -r 526dddf637bb src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c Wed Sep 23 19:50:49 2020 +0300
+++ b/src/http/v2/ngx_http_v2.c Wed Sep 23 19:52:31 2020 +0300
@@ -1058,6 +1058,7 @@ ngx_http_v2_state_read_data(ngx_http_v2_
size_t size;
ngx_buf_t *buf;
ngx_int_t rc;
+ ngx_connection_t *fc;
ngx_http_request_t *r;
ngx_http_v2_stream_t *stream;
ngx_http_v2_srv_conf_t *h2scf;
@@ -1076,6 +1077,7 @@ ngx_http_v2_state_read_data(ngx_http_v2_
}

r = stream->request;
+ fc = r->connection;

if (r->reading_body && !r->request_body_no_buffering) {
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
@@ -1108,6 +1110,8 @@ ngx_http_v2_state_read_data(ngx_http_v2_
ngx_http_finalize_request(r, rc);
}

+ ngx_http_run_posted_requests(fc);
+
} else if (size) {
buf = stream->preread;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] HTTP/2: run posted requests after reading body.

Maxim Dounin 264 September 23, 2020 02:38PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 185
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready