Skip to content

Commit 4a20147

Browse files
magurotunaseanmonstar
authored andcommittedNov 15, 2024·
fix(http2): pass proper value to h2 max_local_error_reset_streams
The patch #3528 added the ability for hyper users to configure `max_local_error_reset_streams` via the server builder to hyper v0.14.29. It was then pulled in to hyper v1.2.0 as well in #3530, where the wrong parameter `max_pending_accept_reset_streams` is passed to h2's builder as `max_local_error_reset_streams`. This could lead to significant impact especially when a hyper user does not set `max_pending_accept_reset_streams`, because its default value is `None` and passing `None` to h2's `max_local_error_reset_streams` method will make the server vulnerable to DOS attacks. This issue has been fixed in this patch, simply by passing the correct value to the h2's builder method.
1 parent 4694f38 commit 4a20147

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/proto/h2/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ where
135135
.initial_connection_window_size(config.initial_conn_window_size)
136136
.max_frame_size(config.max_frame_size)
137137
.max_header_list_size(config.max_header_list_size)
138-
.max_local_error_reset_streams(config.max_pending_accept_reset_streams)
138+
.max_local_error_reset_streams(config.max_local_error_reset_streams)
139139
.max_send_buffer_size(config.max_send_buffer_size);
140140
if let Some(max) = config.max_concurrent_streams {
141141
builder.max_concurrent_streams(max);

0 commit comments

Comments
 (0)
Please sign in to comment.