@@ -527,9 +527,6 @@ pub struct Socket<'a> {
527
527
/// Used for rate-limiting: No more challenge ACKs will be sent until this instant.
528
528
challenge_ack_timer : Instant ,
529
529
530
- /// If this is set, we will not send a SYN|ACK until this is unset.
531
- synack_paused : bool ,
532
-
533
530
/// Nagle's Algorithm enabled.
534
531
nagle : bool ,
535
532
@@ -546,6 +543,10 @@ pub struct Socket<'a> {
546
543
rx_waker : WakerRegistration ,
547
544
#[ cfg( feature = "async" ) ]
548
545
tx_waker : WakerRegistration ,
546
+
547
+ /// If this is set, we will not send a SYN|ACK until this is unset.
548
+ #[ cfg( feature = "socket-tcp-pause-synack" ) ]
549
+ synack_paused : bool ,
549
550
}
550
551
551
552
const DEFAULT_MSS : usize = 536 ;
@@ -604,12 +605,14 @@ impl<'a> Socket<'a> {
604
605
tsval_generator : None ,
605
606
last_remote_tsval : 0 ,
606
607
congestion_controller : congestion:: AnyController :: new ( ) ,
607
- synack_paused : false ,
608
608
609
609
#[ cfg( feature = "async" ) ]
610
610
rx_waker : WakerRegistration :: new ( ) ,
611
611
#[ cfg( feature = "async" ) ]
612
612
tx_waker : WakerRegistration :: new ( ) ,
613
+
614
+ #[ cfg( feature = "socket-tcp-pause-synack" ) ]
615
+ synack_paused : false ,
613
616
}
614
617
}
615
618
@@ -733,6 +736,7 @@ impl<'a> Socket<'a> {
733
736
/// When this flag is set, the socket will get stuck in `SynReceived` state without sending
734
737
/// any SYN|ACK packets back, until this flag is unset. This is useful for certain niche TCP
735
738
/// proxy usecases.
739
+ #[ cfg( feature = "socket-tcp-pause-synack" ) ]
736
740
pub fn pause_synack ( & mut self , pause : bool ) {
737
741
self . synack_paused = pause;
738
742
}
@@ -2385,6 +2389,7 @@ impl<'a> Socket<'a> {
2385
2389
. on_retransmit ( cx. now ( ) ) ;
2386
2390
}
2387
2391
2392
+ #[ cfg( feature = "socket-tcp-pause-synack" ) ]
2388
2393
if matches ! ( self . state, State :: SynReceived ) && self . synack_paused {
2389
2394
return Ok ( ( ) ) ;
2390
2395
}
0 commit comments