src/bin/h2s-client.rs: increase tokio tcp stream read buffer size

This improves download speed by factor 10.
This commit is contained in:
Dietmar Maurer 2019-06-29 18:09:50 +02:00
parent 34f7131160
commit dc9775d1b0

View File

@ -70,6 +70,8 @@ pub fn main() -> Result<(), Error> {
let tcp = tcp_stream
.map_err(Error::from)
.and_then(|c| {
c.set_nodelay(true).unwrap();
c.set_recv_buffer_size(1024*1024).unwrap();
let mut builder = native_tls::TlsConnector::builder();
builder.danger_accept_invalid_certs(true);
let connector = builder.build().unwrap();