You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2021/10/14 10:18:17 UTC
svn commit: r1894228 - /httpd/httpd/trunk/modules/http2/h2_stream.c
Author: icing
Date: Thu Oct 14 10:18:17 2021
New Revision: 1894228
URL: http://svn.apache.org/viewvc?rev=1894228&view=rev
Log:
*) 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).
Modified:
httpd/httpd/trunk/modules/http2/h2_stream.c
Modified: httpd/httpd/trunk/modules/http2/h2_stream.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_stream.c?rev=1894228&r1=1894227&r2=1894228&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_stream.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_stream.c Thu Oct 14 10:18:17 2021
@@ -824,7 +824,7 @@ static apr_status_t buffer_output_receiv
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_st
{
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_st
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;