From: Stefan Eissing Date: Thu, 14 Oct 2021 12:37:25 +0000 (+0000) Subject: *) mod_http2: another travis test of the 400_20 and 401_31 tests that produce a... X-Git-Tag: 2.5.0-alpha2-ci-test-only~733 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a32ff18e4e4cc6a8b6ffbd163bda85af1efdb14d;p=thirdparty%2Fapache%2Fhttpd.git *) mod_http2: another travis test of the 400_20 and 401_31 tests that produce a timeout only on travis and never locally. sorry about the cycles. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894241 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2_headers.c b/modules/http2/h2_headers.c index c1a6a8c3332..3aab859c7bf 100644 --- a/modules/http2/h2_headers.c +++ b/modules/http2/h2_headers.c @@ -205,7 +205,7 @@ h2_headers *h2_headers_die(apr_status_t type, return headers; } -int h2_headers_are_response(h2_headers *headers) +int h2_headers_are_final_response(h2_headers *headers) { return headers->status >= 200; } diff --git a/modules/http2/h2_headers.h b/modules/http2/h2_headers.h index 34b08cd76ce..dfe1429e18a 100644 --- a/modules/http2/h2_headers.h +++ b/modules/http2/h2_headers.h @@ -79,7 +79,7 @@ h2_headers *h2_headers_clone(apr_pool_t *pool, h2_headers *h); h2_headers *h2_headers_die(apr_status_t type, const struct h2_request *req, apr_pool_t *pool); -int h2_headers_are_response(h2_headers *headers); +int h2_headers_are_final_response(h2_headers *headers); /** * Give the number of bytes of all contained header strings. diff --git a/modules/http2/h2_stream.c b/modules/http2/h2_stream.c index 4e8aaa09bb8..ef9e88fffc9 100644 --- a/modules/http2/h2_stream.c +++ b/modules/http2/h2_stream.c @@ -900,7 +900,7 @@ static apr_status_t buffer_output_process_headers(h2_stream *stream) { conn_rec *c1 = stream->session->c1; h2_headers *headers = NULL; - apr_status_t rv = APR_SUCCESS; + apr_status_t rv = APR_EAGAIN; int ngrv = 0, is_empty; h2_ngheader *nh = NULL; apr_bucket *b, *e; @@ -1001,7 +1001,7 @@ static apr_status_t buffer_output_process_headers(h2_stream *stream) * pushes and served its purpose nevertheless */ goto cleanup; } - if (h2_headers_are_response(headers)) { + if (h2_headers_are_final_response(headers)) { stream->response = headers; } @@ -1283,10 +1283,10 @@ static ssize_t stream_data_cb(nghttp2_session *ng2s, "h2_stream(%ld-%d): need more (read len=%ld, %ld in buffer)", session->id, (int)stream_id, (long)length, (long)buf_len); rv = buffer_output_receive(stream); - if (APR_SUCCESS == rv) { - /* process any headers sitting at the buffer head. */ + /* process all headers sitting at the buffer head. */ + while (APR_SUCCESS == rv) { rv = buffer_output_process_headers(stream); - if (APR_SUCCESS != rv) { + if (APR_SUCCESS != rv && APR_EAGAIN != rv) { ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, c1, H2_STRM_LOG(APLOGNO(10300), stream, "data_cb, error processing headers")); @@ -1294,6 +1294,7 @@ static ssize_t stream_data_cb(nghttp2_session *ng2s, } buf_len = buffer_output_data_to_send(stream, &eos); } + if (APR_EOF == rv) { eos = 1; } @@ -1370,9 +1371,15 @@ apr_status_t h2_stream_read_output(h2_stream *stream) 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; + /* process all headers sitting at the buffer head. */ + while (1) { + rv = buffer_output_process_headers(stream); + if (APR_EAGAIN == rv) { + rv = APR_SUCCESS; + break; + } + if (APR_SUCCESS != rv) goto cleanup; + } nghttp2_session_resume_data(stream->session->ngh2, stream->id); ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, c1, diff --git a/test/modules/http2/test_400_push.py b/test/modules/http2/test_400_push.py index df3062953af..d3c21c4f958 100644 --- a/test/modules/http2/test_400_push.py +++ b/test/modules/http2/test_400_push.py @@ -140,7 +140,6 @@ class TestStore: assert 0 == len(promises) # 2 H2PushResource config trigger on GET, but not on POST - @pytest.mark.skip(reason="FIXME: this fails on travis") def test_h2_400_20(self, env, repeat): url = env.mkurl("https", "push", "/006-push20.html") r = env.nghttp().get(url) diff --git a/test/modules/http2/test_401_early_hints.py b/test/modules/http2/test_401_early_hints.py index 8ce687f7be0..42ebc328560 100644 --- a/test/modules/http2/test_401_early_hints.py +++ b/test/modules/http2/test_401_early_hints.py @@ -25,7 +25,6 @@ class TestStore: assert env.apache_restart() == 0 # H2EarlyHints enabled in general, check that it works for H2PushResource - @pytest.mark.skip(reason="FIXME: this fails on travis") def test_h2_401_31(self, env, repeat): url = env.mkurl("https", "hints", "/006-hints.html") r = env.nghttp().get(url)