diff --git a/streamer/src/nonblocking/quic.rs b/streamer/src/nonblocking/quic.rs index ea19be875edcd9..12361b22f3b345 100644 --- a/streamer/src/nonblocking/quic.rs +++ b/streamer/src/nonblocking/quic.rs @@ -362,16 +362,10 @@ fn handle_and_cache_new_connection( params.total_stake, ) as u64) { - connection.set_max_concurrent_uni_streams(max_uni_streams); + let remote_addr = connection.remote_address(); let receive_window = compute_recieve_window(params.max_stake, params.min_stake, params.peer_type); - if let Ok(receive_window) = receive_window { - connection.set_receive_window(receive_window); - } - - let remote_addr = connection.remote_address(); - debug!( "Peer type {:?}, total stake {}, max streams {} receive_window {:?} from peer {}", params.peer_type, @@ -392,6 +386,12 @@ fn handle_and_cache_new_connection( ) { drop(connection_table_l); + + if let Ok(receive_window) = receive_window { + connection.set_receive_window(receive_window); + } + connection.set_max_concurrent_uni_streams(max_uni_streams); + tokio::spawn(handle_connection( connection, remote_addr,