Skip to content

Commit

Permalink
disable TCP nodelay until it can be configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
cfal committed May 28, 2021
1 parent d5b1098 commit ba345aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use treebitmap::IpLookupTable;

const BUFFER_SIZE: usize = 8192;
const ACCEPT_AND_CONNECT_TOGETHER: bool = false;
const TARGET_SET_NODELAY: bool = false;

#[cfg(feature = "tls-native")]
fn create_tls_factory() -> native_tls::NativeTlsFactory {
Expand Down Expand Up @@ -57,8 +58,9 @@ async fn setup_target_stream(
let target_stream =
TcpStream::connect((target_address.address.as_str(), target_address.port)).await?;

// We want commands to be piped through asap in most cases.
target_stream.set_nodelay(true)?;
if TARGET_SET_NODELAY {
target_stream.set_nodelay(true)?;
}

if let Some(ref connector) = target_address.tls_connector {
let tls_stream = connector
Expand Down

0 comments on commit ba345aa

Please sign in to comment.