@@ -571,7 +571,9 @@ impl Connection {
571571 // Whether the next packet will contain ack-eliciting frames.
572572 let mut ack_eliciting = !self . spaces [ space_id] . pending . is_empty ( & self . streams )
573573 || self . spaces [ space_id] . for_path ( path_id) . ping_pending
574- || self . spaces [ space_id] . immediate_ack_pending ;
574+ || self . spaces [ space_id]
575+ . for_path ( path_id)
576+ . immediate_ack_pending ;
575577 if space_id == SpaceId :: Data {
576578 let pn = self . spaces [ SpaceId :: Data ]
577579 . for_path ( path_id)
@@ -821,7 +823,7 @@ impl Connection {
821823 . buf
822824 . segment_size ( )
823825 . saturating_sub ( self . predict_1rtt_overhead ( pn, path_id) ) ;
824- let can_send = self . space_can_send ( space_id, frame_space_1rtt) ;
826+ let can_send = self . space_can_send ( space_id, path_id , frame_space_1rtt) ;
825827 debug_assert ! (
826828 !( sent_frames. is_ack_only( & self . streams)
827829 && !can_send. acks
@@ -911,7 +913,7 @@ impl Connection {
911913 . segment_size ( )
912914 . saturating_sub ( self . predict_1rtt_overhead ( pn, path_id) ) ;
913915 if self
914- . space_can_send ( next_space_id, frame_space_1rtt)
916+ . space_can_send ( next_space_id, path_id , frame_space_1rtt)
915917 . is_empty ( )
916918 {
917919 break ;
@@ -1043,7 +1045,7 @@ impl Connection {
10431045 . saturating_sub ( self . predict_1rtt_overhead ( pn, path_id) ) ;
10441046 let mut space_id = current_space_id;
10451047 loop {
1046- let can_send = self . space_can_send ( space_id, frame_space_1rtt) ;
1048+ let can_send = self . space_can_send ( space_id, path_id , frame_space_1rtt) ;
10471049 if !can_send. is_empty ( ) || ( close && self . spaces [ space_id] . crypto . is_some ( ) ) {
10481050 return Some ( space_id) ;
10491051 }
@@ -1113,7 +1115,12 @@ impl Connection {
11131115 }
11141116
11151117 /// Indicate what types of frames are ready to send for the given space
1116- fn space_can_send ( & self , space_id : SpaceId , frame_space_1rtt : usize ) -> SendableFrames {
1118+ fn space_can_send (
1119+ & self ,
1120+ space_id : SpaceId ,
1121+ path_id : PathId ,
1122+ frame_space_1rtt : usize ,
1123+ ) -> SendableFrames {
11171124 if self . spaces [ space_id] . crypto . is_none ( )
11181125 && ( space_id != SpaceId :: Data
11191126 || self . zero_rtt_crypto . is_none ( )
@@ -1122,8 +1129,7 @@ impl Connection {
11221129 // No keys available for this space
11231130 return SendableFrames :: empty ( ) ;
11241131 }
1125- let space = & self . spaces [ space_id] ;
1126- let mut can_send = space. can_send ( & self . streams , space. immediate_ack_pending ) ;
1132+ let mut can_send = self . spaces [ space_id] . can_send ( path_id, & self . streams ) ;
11271133 if space_id == SpaceId :: Data {
11281134 can_send. other |= self . can_send_1rtt ( frame_space_1rtt) ;
11291135 }
@@ -3021,7 +3027,7 @@ impl Connection {
30213027 // PATH_CHALLENGE on active path, possible off-path packet forwarding
30223028 // attack. Send a non-probing packet to recover the active path.
30233029 match self . peer_supports_ack_frequency ( ) {
3024- true => self . immediate_ack ( ) ,
3030+ true => self . immediate_ack ( path_id ) ,
30253031 false => self . ping ( ) ,
30263032 }
30273033 }
@@ -3523,7 +3529,7 @@ impl Connection {
35233529 }
35243530
35253531 // IMMEDIATE_ACK
3526- if mem:: replace ( & mut space. immediate_ack_pending , false ) {
3532+ if mem:: replace ( & mut space. for_path ( path_id ) . immediate_ack_pending , false ) {
35273533 trace ! ( "IMMEDIATE_ACK" ) ;
35283534 buf. write ( frame:: FrameType :: IMMEDIATE_ACK ) ;
35293535 sent. non_retransmits = true ;
@@ -4029,8 +4035,10 @@ impl Connection {
40294035 ///
40304036 /// According to the spec, this will result in an error if the remote endpoint does not support
40314037 /// the Acknowledgement Frequency extension
4032- pub ( crate ) fn immediate_ack ( & mut self ) {
4033- self . spaces [ self . highest_space ] . immediate_ack_pending = true ;
4038+ pub ( crate ) fn immediate_ack ( & mut self , path_id : PathId ) {
4039+ self . spaces [ self . highest_space ]
4040+ . for_path ( path_id)
4041+ . immediate_ack_pending = true ;
40344042 }
40354043
40364044 /// Decodes a packet, returning its decrypted payload, so it can be inspected in tests
0 commit comments