Skip to content

Commit 7296e7a

Browse files
committed
Merge of PR 301
fix setting of initial connection window size The code for setting the connection initial window size was wrong. refs #300
1 parent 387764b commit 7296e7a

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
* The connection window size was set wrong, preventing `H2WindowSize`
2+
to work. Fixed #300.
3+
14
v2.0.31
25
--------------------------------------------------------------------------------
36
* mod_proxy_http2: revert r1912193 for detecting broken backend connections

mod_http2/h2_session.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,13 +1154,13 @@ static apr_status_t h2_session_start(h2_session *session, int *rv)
11541154
* interim updates, any smaller connection window will lead to blocking
11551155
* in DATA flow.
11561156
*/
1157-
*rv = nghttp2_submit_window_update(session->ngh2, NGHTTP2_FLAG_NONE,
1158-
0, NGHTTP2_MAX_WINDOW_SIZE - win_size);
1157+
*rv = nghttp2_session_set_local_window_size(
1158+
session->ngh2, NGHTTP2_FLAG_NONE, 0, NGHTTP2_MAX_WINDOW_SIZE);
11591159
if (*rv != 0) {
11601160
status = APR_EGENERAL;
11611161
ap_log_cerror(APLOG_MARK, APLOG_ERR, status, session->c1,
11621162
H2_SSSN_LOG(APLOGNO(02970), session,
1163-
"nghttp2_submit_window_update: %s"),
1163+
"nghttp2_session_set_local_window_size: %s"),
11641164
nghttp2_strerror(*rv));
11651165
}
11661166
}

test/modules/http2/test_106_shutdown.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_h2_106_02(self, env):
6666
r = env.curl_get(url, options=['-v'])
6767
# requests should succeed, but rarely connections get closed
6868
# before the response is received
69-
if r.exit_code in [16, 55]:
69+
if r.exit_code in [16, 55, 56]:
7070
# curl send error
7171
assert r.response is None
7272
else:

test/modules/http2/test_107_frame_lengths.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,21 @@ def test_h2_107_01(self, env, data_frame_len):
4949
assert len(r.results["data_lengths"]) > 0, f'{r}'
5050
too_large = [ x for x in r.results["data_lengths"] if x > data_frame_len]
5151
assert len(too_large) == 0, f'{p}: {r.results["data_lengths"]}'
52+
53+
@pytest.mark.parametrize("win_size", [
54+
32*1024, 10*1024, 1024
55+
])
56+
def test_h2_107_02_win_size(self, env, win_size):
57+
conf = H2Conf(env, extras={
58+
f'cgi.{env.http_tld}': [
59+
f'H2WindowSize {win_size}',
60+
]
61+
})
62+
conf.add_vhost_cgi()
63+
conf.install()
64+
assert env.apache_restart() == 0
65+
url = env.mkurl("https", "cgi", self.URI_PATHS[0])
66+
r = env.nghttp().get(url, options=[
67+
'--header=Accept-Encoding: none',
68+
])
69+
assert r.response["status"] == 200

0 commit comments

Comments
 (0)