@@ -3150,6 +3150,7 @@ static uint8_t* picoquic_prepare_datagram_ready(picoquic_cnx_t* cnx, picoquic_pa
3150
3150
*/
3151
3151
3152
3152
static uint8_t * picoquic_prepare_stream_and_datagrams (picoquic_cnx_t * cnx , picoquic_path_t * path_x , uint8_t * bytes_next , uint8_t * bytes_max ,
3153
+ uint64_t max_priority_allowed ,
3153
3154
int * more_data , int * is_pure_ack , int * no_data_to_send , int * ret )
3154
3155
{
3155
3156
int datagram_sent = 0 ;
@@ -3187,7 +3188,7 @@ static uint8_t* picoquic_prepare_stream_and_datagrams(picoquic_cnx_t* cnx, picoq
3187
3188
current_priority = stream_priority ;
3188
3189
}
3189
3190
3190
- if (current_priority == UINT64_MAX ) {
3191
+ if (current_priority == UINT64_MAX || current_priority >= max_priority_allowed ) {
3191
3192
/* Nothing to send! */
3192
3193
if (is_first_round ) {
3193
3194
* no_data_to_send = 1 ;
@@ -3392,13 +3393,25 @@ int picoquic_prepare_packet_almost_ready(picoquic_cnx_t* cnx, picoquic_path_t* p
3392
3393
3393
3394
length = bytes_next - bytes ;
3394
3395
if (path_x -> cwin < path_x -> bytes_in_transit ) {
3395
- picoquic_per_ack_state_t ack_state = { 0 };
3396
- cnx -> cwin_blocked = 1 ;
3397
- path_x -> last_cwin_blocked_time = current_time ;
3398
- if (cnx -> congestion_alg != NULL ) {
3399
- cnx -> congestion_alg -> alg_notify (cnx , path_x ,
3400
- picoquic_congestion_notification_cwin_blocked ,
3401
- & ack_state , current_time );
3396
+ /* Implementation of experimental API, picoquic_set_priority_limit_for_bypass */
3397
+ uint8_t * bytes_next_before_bypass = bytes_next ;
3398
+ if (cnx -> priority_limit_for_bypass > 0 && cnx -> nb_paths == 1 ) {
3399
+ bytes_next = picoquic_prepare_stream_and_datagrams (cnx , path_x , bytes_next , bytes_max ,
3400
+ cnx -> priority_limit_for_bypass ,
3401
+ & more_data , & is_pure_ack , & no_data_to_send , & ret );
3402
+ }
3403
+ if (bytes_next != bytes_next_before_bypass ) {
3404
+ length = bytes_next - bytes ;
3405
+ }
3406
+ else {
3407
+ picoquic_per_ack_state_t ack_state = { 0 };
3408
+ cnx -> cwin_blocked = 1 ;
3409
+ path_x -> last_cwin_blocked_time = current_time ;
3410
+ if (cnx -> congestion_alg != NULL ) {
3411
+ cnx -> congestion_alg -> alg_notify (cnx , path_x ,
3412
+ picoquic_congestion_notification_cwin_blocked ,
3413
+ & ack_state , current_time );
3414
+ }
3402
3415
}
3403
3416
}
3404
3417
else {
@@ -3440,6 +3453,7 @@ int picoquic_prepare_packet_almost_ready(picoquic_cnx_t* cnx, picoquic_path_t* p
3440
3453
}
3441
3454
if (ret == 0 ) {
3442
3455
bytes_next = picoquic_prepare_stream_and_datagrams (cnx , path_x , bytes_next , bytes_max ,
3456
+ UINT64_MAX ,
3443
3457
& more_data , & is_pure_ack , & no_data_to_send , & ret );
3444
3458
}
3445
3459
/* TODO: replace this by posting of frame when CWIN estimated */
@@ -3774,7 +3788,7 @@ int picoquic_prepare_packet_ready(picoquic_cnx_t* cnx, picoquic_path_t* path_x,
3774
3788
bytes_next = picoquic_format_ack_frequency_frame (cnx , bytes_next , bytes_max , & more_data );
3775
3789
}
3776
3790
if (ret == 0 ) {
3777
- bytes_next = picoquic_prepare_stream_and_datagrams (cnx , path_x , bytes_next , bytes_max ,
3791
+ bytes_next = picoquic_prepare_stream_and_datagrams (cnx , path_x , bytes_next , bytes_max , UINT64_MAX ,
3778
3792
& more_data , & is_pure_ack , & no_data_to_send , & ret );
3779
3793
}
3780
3794
0 commit comments