aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2020-09-23 19:52:31 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2020-09-23 19:52:31 +0300
commit6c89d752c8ab3a3cc0832927484808b68153f8c4 (patch)
tree0f031c47dbef09e567671b2c3bf4dd65b70442d6 /src
parent7c67ff73634acde729ceb151110f8db10322a33e (diff)
downloadnginx-6c89d752c8ab3a3cc0832927484808b68153f8c4.tar.gz
nginx-6c89d752c8ab3a3cc0832927484808b68153f8c4.zip
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 (limited to 'src')
-rw-r--r--src/http/v2/ngx_http_v2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c
index 9c994b8a3..43a4fded5 100644
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -1058,6 +1058,7 @@ ngx_http_v2_state_read_data(ngx_http_v2_connection_t *h2c, u_char *pos,
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_connection_t *h2c, u_char *pos,
}
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_connection_t *h2c, u_char *pos,
ngx_http_finalize_request(r, rc);
}
+ ngx_http_run_posted_requests(fc);
+
} else if (size) {
buf = stream->preread;