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 12:37:25 UTC
svn commit: r1894241 - in /httpd/httpd/trunk: 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
Author: icing
Date: Thu Oct 14 12:37:25 2021
New Revision: 1894241
URL: http://svn.apache.org/viewvc?rev=1894241&view=rev
Log:
*) 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.
Modified:
httpd/httpd/trunk/modules/http2/h2_headers.c
httpd/httpd/trunk/modules/http2/h2_headers.h
httpd/httpd/trunk/modules/http2/h2_stream.c
httpd/httpd/trunk/test/modules/http2/test_400_push.py
httpd/httpd/trunk/test/modules/http2/test_401_early_hints.py
Modified: httpd/httpd/trunk/modules/http2/h2_headers.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_headers.c?rev=1894241&r1=1894240&r2=1894241&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_headers.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_headers.c Thu Oct 14 12:37:25 2021
@@ -205,7 +205,7 @@ h2_headers *h2_headers_die(apr_status_t
return headers;
}
-int h2_headers_are_response(h2_headers *headers)
+int h2_headers_are_final_response(h2_headers *headers)
{
return headers->status >= 200;
}
Modified: httpd/httpd/trunk/modules/http2/h2_headers.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_headers.h?rev=1894241&r1=1894240&r2=1894241&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_headers.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_headers.h Thu Oct 14 12:37:25 2021
@@ -79,7 +79,7 @@ h2_headers *h2_headers_clone(apr_pool_t
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.
Modified: httpd/httpd/trunk/modules/http2/h2_stream.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_stream.c?rev=1894241&r1=1894240&r2=1894241&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_stream.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_stream.c Thu Oct 14 12:37:25 2021
@@ -900,7 +900,7 @@ static apr_status_t buffer_output_proces
{
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_proces
* 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_se
"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_se
}
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_st
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,
Modified: httpd/httpd/trunk/test/modules/http2/test_400_push.py
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/modules/http2/test_400_push.py?rev=1894241&r1=1894240&r2=1894241&view=diff
==============================================================================
--- httpd/httpd/trunk/test/modules/http2/test_400_push.py (original)
+++ httpd/httpd/trunk/test/modules/http2/test_400_push.py Thu Oct 14 12:37:25 2021
@@ -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)
Modified: httpd/httpd/trunk/test/modules/http2/test_401_early_hints.py
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/modules/http2/test_401_early_hints.py?rev=1894241&r1=1894240&r2=1894241&view=diff
==============================================================================
--- httpd/httpd/trunk/test/modules/http2/test_401_early_hints.py (original)
+++ httpd/httpd/trunk/test/modules/http2/test_401_early_hints.py Thu Oct 14 12:37:25 2021
@@ -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)