File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,8 @@ impl P2pNetworkYamuxState {
216216 if let Some ( stream) = yamux_state. streams . get_mut ( & frame. stream_id ) {
217217 // must not underflow
218218 // TODO: check it and disconnect peer that violates flow rules
219- stream. window_ours = stream. window_ours . wrapping_sub ( data. len ( ) as u32 ) ;
219+ stream. window_ours =
220+ stream. window_ours . saturating_sub ( data. len ( ) as u32 ) ;
220221 }
221222 }
222223 YamuxFrameInner :: WindowUpdate { difference } => {
Original file line number Diff line number Diff line change @@ -484,6 +484,11 @@ where
484484 if limit > self . recv_buf . len ( ) {
485485 // TODO: upper bound? resize to `limit` or try to allocate some extra space too?
486486 self . recv_buf . resize ( limit, 0 ) ;
487+
488+ openmina_core:: warn!(
489+ openmina_core:: log:: system_time( ) ;
490+ summary = format!( "Increasing buffer size to {}kb" , limit / 1024 )
491+ ) ;
487492 }
488493
489494 let mut keep = false ;
You can’t perform that action at this time.
0 commit comments