fix(http2): reduce memory usage
This commit is contained in:
parent
b7dbd864c4
commit
782fbbc04d
1 changed files with 2 additions and 1 deletions
|
@ -82,7 +82,7 @@ impl TunnelWrite for Http2TunnelWrite {
|
||||||
|
|
||||||
if self.buf.capacity() < MAX_PACKET_LENGTH {
|
if self.buf.capacity() < MAX_PACKET_LENGTH {
|
||||||
//info!("read {} Kb {} Kb", self.buf.capacity() / 1024, old_capa / 1024);
|
//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
|
ret
|
||||||
|
@ -141,6 +141,7 @@ pub async fn connect(
|
||||||
let transport = pooled_cnx.deref_mut().take().unwrap();
|
let transport = pooled_cnx.deref_mut().take().unwrap();
|
||||||
let (mut request_sender, cnx) = hyper::client::conn::http2::Builder::new(TokioExecutor::new())
|
let (mut request_sender, cnx) = hyper::client::conn::http2::Builder::new(TokioExecutor::new())
|
||||||
.timer(TokioTimer::new())
|
.timer(TokioTimer::new())
|
||||||
|
.adaptive_window(true)
|
||||||
.keep_alive_interval(client_cfg.websocket_ping_frequency)
|
.keep_alive_interval(client_cfg.websocket_ping_frequency)
|
||||||
.keep_alive_while_idle(false)
|
.keep_alive_while_idle(false)
|
||||||
.handshake(TokioIo::new(transport))
|
.handshake(TokioIo::new(transport))
|
||||||
|
|
Loading…
Reference in a new issue