From: Stefan Eissing Date: Thu, 14 Oct 2021 10:18:17 +0000 (+0000) Subject: *) mod_http2: when pollset signals output, resume a streams data X-Git-Tag: 2.5.0-alpha2-ci-test-only~735 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7891b6f69463cd04de5a1b6192cc58d80a690746;p=thirdparty%2Fapache%2Fhttpd.git *) mod_http2: when pollset signals output, resume a streams data in nghttp2 every time without checks that response body bytes are available. This resolves the situation that a stream may stall when 2 consecutive H2HEADER buckets are sent (e.g. 103+200). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894228 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2_stream.c b/modules/http2/h2_stream.c index 274ee157072..4e8aaa09bb8 100644 --- a/modules/http2/h2_stream.c +++ b/modules/http2/h2_stream.c @@ -824,7 +824,7 @@ static apr_status_t buffer_output_receive(h2_stream *stream) buf_len = 0; } else { - /* if the brigade contains a file bucket, it normal report length + /* if the brigade contains a file bucket, its normal report length * might be megabytes, but the memory used is tiny. For buffering, * we are only interested in the memory footprint. */ buf_len = h2_brigade_mem_size(stream->out_buffer); @@ -1336,8 +1336,6 @@ apr_status_t h2_stream_read_output(h2_stream *stream) { conn_rec *c1 = stream->session->c1; apr_status_t rv = APR_EAGAIN; - apr_off_t buf_len; - int eos; /* stream->pout_recv_write signalled a change. Check what has happend, read * from it and act on seeing a response/data. */ @@ -1369,22 +1367,17 @@ apr_status_t h2_stream_read_output(h2_stream *stream) goto cleanup; } - buf_len = buffer_output_data_to_send(stream, &eos); - if (buf_len < stream->session->io.write_size) { - rv = buffer_output_receive(stream); - if (APR_SUCCESS == rv) { - /* process any headers sitting at the buffer head. */ - rv = buffer_output_process_headers(stream); - if (APR_SUCCESS != rv) goto cleanup; - } - buf_len = buffer_output_data_to_send(stream, &eos); - if (buf_len || eos) { - nghttp2_session_resume_data(stream->session->ngh2, stream->id); - ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, c1, - "h2_stream(%ld-%d): resumed", - stream->session->id, (int)stream->id); - } - } + rv = buffer_output_receive(stream); + if (APR_SUCCESS != rv) goto cleanup; + + /* process any headers sitting at the buffer head. */ + rv = buffer_output_process_headers(stream); + if (APR_SUCCESS != rv) goto cleanup; + + nghttp2_session_resume_data(stream->session->ngh2, stream->id); + ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, c1, + "h2_stream(%ld-%d): resumed", + stream->session->id, (int)stream->id); cleanup: return rv;