From 5cff9ab5f7267c71d5074db0c08926084cdb112e Mon Sep 17 00:00:00 2001 From: Matthias Einwag Date: Wed, 17 Feb 2021 18:22:58 +0000 Subject: [PATCH] Set `segment_size` based on the amount of sent datagrams The option only needs to be sent for GSO (multiple datagrams in a buffer). --- quinn-proto/src/connection/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index b5501665d..85a787fa8 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -556,7 +556,10 @@ where } else { None }, - segment_size: None, + segment_size: match num_datagrams { + 1 => None, + _ => Some(self.path.mtu as usize), + }, src_ip: self.local_ip, }) }