Skip to content

Commit

Permalink
Disable Nagle's algorithm (TCP_NODELAY)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuki committed Apr 1, 2024
1 parent 37998fe commit 6d22a26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion native/yaha_native/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ impl YahaNativeContextInternal<'_> {
.https_or_http()
.enable_http2();

builder.build()
// Almost the same as `builder.build()`, but specify `set_nodelay(true)`.
let mut http_conn = HttpConnector::new();
http_conn.set_nodelay(true);
http_conn.enforce_http(false);
builder.wrap_connector(http_conn)
}

#[cfg(feature = "native")]
Expand Down

0 comments on commit 6d22a26

Please sign in to comment.