@@ -3749,15 +3749,28 @@ int picoquic_prepare_packet_ready(picoquic_cnx_t* cnx, picoquic_path_t* path_x,
3749
3749
3750
3750
if ((path_x -> cwin < path_x -> bytes_in_transit || cnx -> quic -> cwin_max < path_x -> bytes_in_transit )
3751
3751
&& !path_x -> is_pto_required ) {
3752
- cnx -> cwin_blocked = 1 ;
3753
- path_x -> last_cwin_blocked_time = current_time ;
3754
- if (cnx -> congestion_alg != NULL ) {
3755
- picoquic_per_ack_state_t ack_state = { 0 };
3756
-
3757
- cnx -> congestion_alg -> alg_notify (cnx , path_x ,
3758
- picoquic_congestion_notification_cwin_blocked ,
3759
- & ack_state , current_time );
3760
- }
3752
+ /* Implementation of experimental API, picoquic_set_priority_limit_for_bypass */
3753
+ uint8_t * bytes_next_before_bypass = bytes_next ;
3754
+ int no_data_to_send = 0 ;
3755
+ if (cnx -> priority_limit_for_bypass > 0 && cnx -> nb_paths == 1 ) {
3756
+ bytes_next = picoquic_prepare_stream_and_datagrams (cnx , path_x , bytes_next , bytes_max ,
3757
+ cnx -> priority_limit_for_bypass ,
3758
+ & more_data , & is_pure_ack , & no_data_to_send , & ret );
3759
+ }
3760
+ if (bytes_next != bytes_next_before_bypass ) {
3761
+ length = bytes_next - bytes ;
3762
+ }
3763
+ else {
3764
+ cnx -> cwin_blocked = 1 ;
3765
+ path_x -> last_cwin_blocked_time = current_time ;
3766
+ if (cnx -> congestion_alg != NULL ) {
3767
+ picoquic_per_ack_state_t ack_state = { 0 };
3768
+
3769
+ cnx -> congestion_alg -> alg_notify (cnx , path_x ,
3770
+ picoquic_congestion_notification_cwin_blocked ,
3771
+ & ack_state , current_time );
3772
+ }
3773
+ }
3761
3774
}
3762
3775
else {
3763
3776
/* Send here the frames that are subject to both congestion and pacing control.
@@ -3865,6 +3878,16 @@ int picoquic_prepare_packet_ready(picoquic_cnx_t* cnx, picoquic_path_t* path_x,
3865
3878
}
3866
3879
} /* end of CC */
3867
3880
} /* End of pacing */
3881
+ else if (cnx -> priority_limit_for_bypass > 0 && cnx -> nb_paths == 1 ) {
3882
+ /* If congestion bypass is implemented, also consider pacing bypass */
3883
+ int no_data_to_send = 0 ;
3884
+
3885
+ if ((bytes_next = picoquic_prepare_stream_and_datagrams (cnx , path_x , bytes_next , bytes_max ,
3886
+ cnx -> priority_limit_for_bypass ,
3887
+ & more_data , & is_pure_ack , & no_data_to_send , & ret )) != NULL ) {
3888
+ length = bytes_next - bytes ;
3889
+ }
3890
+ }
3868
3891
} /* End of challenge verified */
3869
3892
}
3870
3893
0 commit comments