Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 5c93f6e

Browse files
mergify[bot]alessandrod
authored andcommitted
v1.17: quic: delay calling set_max_concurrent_uni_streams/set_receive_window (backport of #904) (#967)
* quic: delay calling set_max_concurrent_uni_streams/set_receive_window (#904) * quic: don't call connection.set_max_concurrent_uni_streams if we're going to drop a connection Avoids taking a mutex and waking a task. * quic: don't increase the receive window before we've actually accepted a connection (cherry picked from commit 2770424) # Conflicts: # streamer/src/nonblocking/quic.rs * Fix merge conflicts --------- Co-authored-by: Alessandro Decina <[email protected]>
1 parent ef01ab1 commit 5c93f6e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

streamer/src/nonblocking/quic.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,18 +342,12 @@ fn handle_and_cache_new_connection(
342342
params.total_stake,
343343
) as u64)
344344
{
345-
connection.set_max_concurrent_uni_streams(max_uni_streams);
346345
let receive_window = compute_recieve_window(
347346
params.max_stake,
348347
params.min_stake,
349348
connection_table_l.peer_type,
350349
params.stake,
351350
);
352-
353-
if let Ok(receive_window) = receive_window {
354-
connection.set_receive_window(receive_window);
355-
}
356-
357351
let remote_addr = connection.remote_address();
358352

359353
debug!(
@@ -376,6 +370,12 @@ fn handle_and_cache_new_connection(
376370
) {
377371
let peer_type = connection_table_l.peer_type;
378372
drop(connection_table_l);
373+
374+
if let Ok(receive_window) = receive_window {
375+
connection.set_receive_window(receive_window);
376+
}
377+
connection.set_max_concurrent_uni_streams(max_uni_streams);
378+
379379
tokio::spawn(handle_connection(
380380
connection,
381381
remote_addr,

0 commit comments

Comments
 (0)