File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -1123,21 +1123,21 @@ impl<'a> Socket<'a> {
1123
1123
return Err ( SendError :: InvalidState ) ;
1124
1124
}
1125
1125
1126
- // The connection might have been idle for a long time, and so remote_last_ts
1127
- // would be far in the past. Unless we clear it here, we'll abort the connection
1128
- // down over in dispatch() by erroneously detecting it as timed out.
1129
- if self . tx_buffer . is_empty ( ) {
1130
- self . remote_last_ts = None
1131
- }
1132
-
1133
- let _old_length = self . tx_buffer . len ( ) ;
1126
+ let old_length = self . tx_buffer . len ( ) ;
1134
1127
let ( size, result) = f ( & mut self . tx_buffer ) ;
1135
1128
if size > 0 {
1129
+ // The connection might have been idle for a long time, and so remote_last_ts
1130
+ // would be far in the past. Unless we clear it here, we'll abort the connection
1131
+ // down over in dispatch() by erroneously detecting it as timed out.
1132
+ if old_length == 0 {
1133
+ self . remote_last_ts = None
1134
+ }
1135
+
1136
1136
#[ cfg( any( test, feature = "verbose" ) ) ]
1137
1137
tcp_trace ! (
1138
1138
"tx buffer: enqueueing {} octets (now {})" ,
1139
1139
size,
1140
- _old_length + size
1140
+ old_length + size
1141
1141
) ;
1142
1142
}
1143
1143
Ok ( result)
You can’t perform that action at this time.
0 commit comments