comparison src/http/v2/ngx_http_v2.c @ 7711:526dddf637bb

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 23 Sep 2020 19:52:31 +0300
parents 097f578a4a8f
children 554c6ae25ffc
comparison
equal deleted inserted replaced
7710:097f578a4a8f 7711:526dddf637bb
1056 u_char *end) 1056 u_char *end)
1057 { 1057 {
1058 size_t size; 1058 size_t size;
1059 ngx_buf_t *buf; 1059 ngx_buf_t *buf;
1060 ngx_int_t rc; 1060 ngx_int_t rc;
1061 ngx_connection_t *fc;
1061 ngx_http_request_t *r; 1062 ngx_http_request_t *r;
1062 ngx_http_v2_stream_t *stream; 1063 ngx_http_v2_stream_t *stream;
1063 ngx_http_v2_srv_conf_t *h2scf; 1064 ngx_http_v2_srv_conf_t *h2scf;
1064 1065
1065 stream = h2c->state.stream; 1066 stream = h2c->state.stream;
1074 1075
1075 return ngx_http_v2_state_skip_padded(h2c, pos, end); 1076 return ngx_http_v2_state_skip_padded(h2c, pos, end);
1076 } 1077 }
1077 1078
1078 r = stream->request; 1079 r = stream->request;
1080 fc = r->connection;
1079 1081
1080 if (r->reading_body && !r->request_body_no_buffering) { 1082 if (r->reading_body && !r->request_body_no_buffering) {
1081 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0, 1083 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, h2c->connection->log, 0,
1082 "skipping http2 DATA frame"); 1084 "skipping http2 DATA frame");
1083 1085
1105 1107
1106 if (rc != NGX_OK) { 1108 if (rc != NGX_OK) {
1107 stream->skip_data = 1; 1109 stream->skip_data = 1;
1108 ngx_http_finalize_request(r, rc); 1110 ngx_http_finalize_request(r, rc);
1109 } 1111 }
1112
1113 ngx_http_run_posted_requests(fc);
1110 1114
1111 } else if (size) { 1115 } else if (size) {
1112 buf = stream->preread; 1116 buf = stream->preread;
1113 1117
1114 if (buf == NULL) { 1118 if (buf == NULL) {