File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ where
152152 return Err ( Error :: InvalidStreamId ) ;
153153 }
154154
155- let mut state = match self . recv_streams . entry ( stream. id ) {
155+ match self . recv_streams . entry ( stream. id ) {
156156 hash_map:: Entry :: Vacant ( e) => {
157157 if self . is_server == stream. id . server_initiated ( ) {
158158 // Already closed, ignore it. TODO slightly wrong
@@ -208,16 +208,21 @@ where
208208 }
209209 } ;
210210
211- e. insert_entry ( recv_backend)
211+ let fin = stream. fin ;
212+ recv_backend. inbound_data . send ( stream) . ok ( ) ;
213+
214+ if !fin {
215+ e. insert ( recv_backend) ;
216+ }
217+ }
218+ hash_map:: Entry :: Occupied ( mut e) => {
219+ let fin = stream. fin ;
220+ e. get_mut ( ) . inbound_data . send ( stream) . ok ( ) ;
221+ if fin {
222+ e. remove ( ) ;
223+ }
212224 }
213- hash_map:: Entry :: Occupied ( e) => e,
214225 } ;
215-
216- let fin = stream. fin ;
217- state. get_mut ( ) . inbound_data . send ( stream) . ok ( ) ;
218- if fin {
219- state. remove ( ) ;
220- }
221226 }
222227 Frame :: ResetStream ( reset) => {
223228 if !reset. id . can_recv ( self . is_server ) {
You can’t perform that action at this time.
0 commit comments