File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -786,6 +786,16 @@ impl Recv {
786786 }
787787 }
788788
789+ pub ( super ) fn maybe_reset_next_stream_id ( & mut self , id : StreamId ) {
790+ if let Ok ( next_id) = self . next_stream_id {
791+ // !Peer::is_local_init should have been called beforehand
792+ debug_assert_eq ! ( id. is_server_initiated( ) , next_id. is_server_initiated( ) ) ;
793+ if id >= next_id {
794+ self . next_stream_id = id. next_id ( ) ;
795+ }
796+ }
797+ }
798+
789799 /// Returns true if the remote peer can reserve a stream with the given ID.
790800 pub fn ensure_can_reserve ( & self ) -> Result < ( ) , Error > {
791801 if !self . is_push_enabled {
Original file line number Diff line number Diff line change @@ -883,6 +883,10 @@ impl Inner {
883883 // We normally would open this stream, so update our
884884 // next-send-id record.
885885 self . actions . send . maybe_reset_next_stream_id ( id) ;
886+ } else {
887+ // We normally would recv this stream, so update our
888+ // next-recv-id record.
889+ self . actions . recv . maybe_reset_next_stream_id ( id) ;
886890 }
887891
888892 let stream = Stream :: new ( id, 0 , 0 ) ;
You can’t perform that action at this time.
0 commit comments