File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,16 @@ mod util;
2626#[ derive( Debug , Clone ) ]
2727#[ non_exhaustive]
2828pub struct ConnectFlags {
29+ pub tcp_nodelay : bool ,
2930 pub echo : bool ,
3031 #[ cfg( feature = "non-standard-zstd" ) ]
3132 pub zstd_compression_level : Option < u8 > ,
3233}
3334
34- #[ cfg_attr( not( feature = "non-standard-zstd" ) , expect( clippy:: derivable_impls) ) ]
3535impl Default for ConnectFlags {
3636 fn default ( ) -> Self {
3737 Self {
38+ tcp_nodelay : true ,
3839 echo : false ,
3940 #[ cfg( feature = "non-standard-zstd" ) ]
4041 zstd_compression_level : Some ( 3 ) ,
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ pub(crate) async fn connect(
6767 ConnectError ,
6868> {
6969 let conn = connect_tcp ( addr) . await . map_err ( ConnectError :: Io ) ?;
70- conn. set_nodelay ( true ) . map_err ( ConnectError :: Io ) ?;
70+ conn. set_nodelay ( flags. tcp_nodelay )
71+ . map_err ( ConnectError :: Io ) ?;
7172 let mut conn = ConnectionSecurity :: Plain ( conn) ;
7273
7374 if matches ! ( addr. protocol( ) , Protocol :: TLS ) {
You can’t perform that action at this time.
0 commit comments