Skip to content

Commit

Permalink
fix(http2): reduce memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe committed Jan 21, 2024
1 parent b7dbd86 commit 782fbbc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tunnel/transport/http2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl TunnelWrite for Http2TunnelWrite {

if self.buf.capacity() < MAX_PACKET_LENGTH {
//info!("read {} Kb {} Kb", self.buf.capacity() / 1024, old_capa / 1024);
self.buf.reserve(MAX_PACKET_LENGTH * 4)
self.buf.reserve(MAX_PACKET_LENGTH)
}

ret
Expand Down Expand Up @@ -141,6 +141,7 @@ pub async fn connect(
let transport = pooled_cnx.deref_mut().take().unwrap();
let (mut request_sender, cnx) = hyper::client::conn::http2::Builder::new(TokioExecutor::new())
.timer(TokioTimer::new())
.adaptive_window(true)
.keep_alive_interval(client_cfg.websocket_ping_frequency)
.keep_alive_while_idle(false)
.handshake(TokioIo::new(transport))
Expand Down

0 comments on commit 782fbbc

Please sign in to comment.