@@ -341,7 +341,7 @@ impl TcpProxy {
341
341
}
342
342
343
343
fn switch_to_connected ( & mut self ) {
344
- self . status = ProxyStatus :: Connected ;
344
+ self . status = ProxyStatus :: ConnectedUnconfirmed ;
345
345
match fcntl ( self . fd , FcntlArg :: F_GETFL ) {
346
346
Ok ( flags) => match OFlag :: from_bits ( flags) {
347
347
Some ( flags) => {
@@ -395,7 +395,7 @@ impl Proxy for TcpProxy {
395
395
if self . status == ProxyStatus :: Connecting {
396
396
update. polling = Some ( ( self . id , self . fd , EventSet :: IN | EventSet :: OUT ) ) ;
397
397
} else {
398
- if self . status == ProxyStatus :: Connected {
398
+ if self . status == ProxyStatus :: ConnectedUnconfirmed {
399
399
update. polling = Some ( ( self . id , self . fd , EventSet :: IN ) ) ;
400
400
}
401
401
self . push_connect_rsp ( result) ;
@@ -413,6 +413,15 @@ impl Proxy for TcpProxy {
413
413
self . peer_port,
414
414
) ;
415
415
416
+ if self . status != ProxyStatus :: ConnectedUnconfirmed {
417
+ warn ! (
418
+ "tcp: confirm_connect: Expected state to be {:?}, but it is {:?}" ,
419
+ ProxyStatus :: ConnectedUnconfirmed ,
420
+ self . status
421
+ ) ;
422
+ }
423
+ self . status = ProxyStatus :: Connected ;
424
+
416
425
self . peer_buf_alloc = pkt. buf_alloc ( ) ;
417
426
self . peer_fwd_cnt = Wrapping ( pkt. fwd_cnt ( ) ) ;
418
427
0 commit comments