From cf82aedb12f22c8b929e372cb0f78ab93c366b83 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Tue, 23 Mar 2021 15:31:59 -0400 Subject: [PATCH] use TCP MSS as chunk size --- src/routes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes.rs b/src/routes.rs index 7698bdd..7a2c477 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -250,7 +250,7 @@ fn construct_response(cached: &CachedImage) -> ServerResponse { let data: Vec> = cached .data .to_vec() - .chunks(1024) + .chunks(1460) // TCP MSS default size .map(|v| Ok(Bytes::from(v.to_vec()))) .collect(); let mut resp = HttpResponse::Ok();