@@ -89,6 +89,7 @@ mod imp {
8989 pub client_private_key : Option < Vec < u8 > > ,
9090 /// ⚠️ DANGEROUS: Skip TLS certificate verification (for testing only!)
9191 pub insecure_skip_verify : bool ,
92+ pub datagram_receive_buffer_size : usize ,
9293 }
9394
9495 /// Builder for `QuicConfig` to simplify ergonomic construction.
@@ -99,6 +100,7 @@ mod imp {
99100 client_cert_chain : Option < Vec < Vec < u8 > > > ,
100101 client_private_key : Option < Vec < u8 > > ,
101102 insecure_skip_verify : bool ,
103+ datagram_receive_buffer_size : usize ,
102104 }
103105
104106 impl QuicConfigBuilder {
@@ -210,6 +212,11 @@ mod imp {
210212 Ok ( self )
211213 }
212214
215+ pub fn datagram_receive_buffer_size ( mut self , size : usize ) -> Self {
216+ self . datagram_receive_buffer_size = size;
217+ self
218+ }
219+
213220 /// Provide a client private key for mutual TLS (DER-encoded bytes)
214221 pub fn client_private_key ( mut self , key : Vec < u8 > ) -> Self {
215222 self . client_private_key = Some ( key) ;
@@ -273,6 +280,7 @@ mod imp {
273280 client_cert_chain : self . client_cert_chain ,
274281 client_private_key : self . client_private_key ,
275282 insecure_skip_verify : self . insecure_skip_verify ,
283+ datagram_receive_buffer_size : self . datagram_receive_buffer_size ,
276284 }
277285 }
278286 }
@@ -287,6 +295,7 @@ mod imp {
287295 client_cert_chain : None ,
288296 client_private_key : None ,
289297 insecure_skip_verify : false ,
298+ datagram_receive_buffer_size : 0 ,
290299 }
291300 }
292301 }
@@ -418,7 +427,10 @@ mod imp {
418427 }
419428 } ;
420429
421- let quinn_crypto = ClientConfig :: new ( Arc :: new ( quic_client_cfg) ) ;
430+ let mut quinn_crypto = ClientConfig :: new ( Arc :: new ( quic_client_cfg) ) ;
431+ let mut trpt_cfg = quinn:: TransportConfig :: default ( ) ;
432+ trpt_cfg. datagram_receive_buffer_size ( Some ( cfg. datagram_receive_buffer_size ) ) ;
433+ quinn_crypto. transport_config ( Arc :: new ( trpt_cfg) ) ;
422434
423435 // Create an endpoint bound to an ephemeral UDP port
424436 let mut endpoint = Endpoint :: client ( "0.0.0.0:0" . parse ( ) . unwrap ( ) ) . map_err ( |e| {
0 commit comments