@@ -3822,7 +3822,17 @@ uint8_t* picoquic_format_ack_frame_in_context(picoquic_cnx_t* cnx, uint8_t* byte
3822
3822
(((is_ecn ) ? picoquic_frame_type_path_ack_ecn : picoquic_frame_type_path_ack ));
3823
3823
3824
3824
/* Check that there something to acknowledge */
3825
+ #if 1
3826
+ int not_needed = picoquic_sack_list_is_empty (& ack_ctx -> sack_list );
3827
+ if (!not_needed && !ack_ctx -> act [is_opportunistic ].ack_needed &&
3828
+ ack_ctx -> sack_list .ack_tree .size == 1 ) {
3829
+ picoquic_sack_item_t * last_sack = picoquic_sack_last_item (& ack_ctx -> sack_list );
3830
+ not_needed = (last_sack -> nb_times_sent [is_opportunistic ] >= PICOQUIC_MAX_ACK_RANGE_REPEAT );
3831
+ }
3832
+ if (!not_needed ){
3833
+ #else
3825
3834
if (!picoquic_sack_list_is_empty (& ack_ctx -> sack_list )) {
3835
+ #endif
3826
3836
uint8_t * num_block_byte = NULL ;
3827
3837
picoquic_sack_item_t * last_sack = picoquic_sack_last_item (& ack_ctx -> sack_list );
3828
3838
@@ -3956,6 +3966,15 @@ uint8_t * picoquic_format_ack_frame(picoquic_cnx_t* cnx, uint8_t* bytes, uint8_t
3956
3966
for (int path_id = 0 ; path_id < cnx -> nb_paths ; path_id ++ ) {
3957
3967
if (bytes != NULL ) {
3958
3968
ack_ctx = & cnx -> path [path_id ]-> ack_ctx ;
3969
+ /* Adding test to verify that we do not send too many acks after demotion. */
3970
+ if (cnx -> path [path_id ]-> path_is_demoted &&
3971
+ !ack_ctx -> act [is_opportunistic ].ack_needed &&
3972
+ ack_ctx -> sack_list .ack_tree .size == 1 ) {
3973
+ picoquic_sack_item_t * last_sack = picoquic_sack_last_item (& ack_ctx -> sack_list );
3974
+ if (last_sack -> nb_times_sent [is_opportunistic ] >= PICOQUIC_MIN_ACK_RANGE_REPEAT ) {
3975
+ continue ;
3976
+ }
3977
+ }
3959
3978
bytes = picoquic_format_ack_frame_in_context (cnx , bytes , bytes_max , more_data ,
3960
3979
current_time , ack_ctx , & need_time_stamp , cnx -> path [path_id ]-> unique_path_id , is_opportunistic );
3961
3980
if (is_opportunistic ) {
0 commit comments