]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_http2: another travis test of the 400_20 and 401_31 tests that produce a...
authorStefan Eissing <icing@apache.org>
Thu, 14 Oct 2021 12:37:25 +0000 (12:37 +0000)
committerStefan Eissing <icing@apache.org>
Thu, 14 Oct 2021 12:37:25 +0000 (12:37 +0000)
     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

modules/http2/h2_headers.c
modules/http2/h2_headers.h
modules/http2/h2_stream.c
test/modules/http2/test_400_push.py
test/modules/http2/test_401_early_hints.py

index c1a6a8c333274983c8e7ae8ec7c638871bfb26d4..3aab859c7bf3512e7913c1d60d0564774538bc7e 100644 (file)
@@ -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;
 }
index 34b08cd76ceb025c93a3f54d34f8959ec5d25546..dfe1429e18a8ba42fe01ab2dd2495aaf8176c73f 100644 (file)
@@ -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.
index 4e8aaa09bb8d052a49706e175a71f267e4a1784f..ef9e88fffc9cfc90de4467d43b3640508b4afdd6 100644 (file)
@@ -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,
index df3062953af438e5fd132dc1288109020592721a..d3c21c4f958f5061d2755a23e323ec07d58ab899 100644 (file)
@@ -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)
index 8ce687f7be0c18a2c58fdde52a29983713cbd085..42ebc3285607d6af4cb949771c3ff86dbaa6ae70 100644 (file)
@@ -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)