Skip to content

Commit fad3699

Browse files
committed
Trim number of acks after Abandon.
1 parent 06e753e commit fad3699

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

picoquic/frames.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,7 +3822,17 @@ uint8_t* picoquic_format_ack_frame_in_context(picoquic_cnx_t* cnx, uint8_t* byte
38223822
(((is_ecn) ? picoquic_frame_type_path_ack_ecn : picoquic_frame_type_path_ack));
38233823

38243824
/* 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
38253834
if (!picoquic_sack_list_is_empty(&ack_ctx->sack_list)) {
3835+
#endif
38263836
uint8_t* num_block_byte = NULL;
38273837
picoquic_sack_item_t* last_sack = picoquic_sack_last_item(&ack_ctx->sack_list);
38283838

@@ -3956,6 +3966,15 @@ uint8_t * picoquic_format_ack_frame(picoquic_cnx_t* cnx, uint8_t* bytes, uint8_t
39563966
for (int path_id = 0; path_id < cnx->nb_paths; path_id++) {
39573967
if (bytes != NULL) {
39583968
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+
}
39593978
bytes = picoquic_format_ack_frame_in_context(cnx, bytes, bytes_max, more_data,
39603979
current_time, ack_ctx, &need_time_stamp, cnx->path[path_id]->unique_path_id, is_opportunistic);
39613980
if (is_opportunistic) {

picoquictest/multipath_qlog_ref.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@
333333
[76910, 1, "transport", "packet_received", { "packet_type": "1RTT", "header": { "packet_size": 55, "packet_number": 6, "dcid": "1209080706050403" }, "frames": [{
334334
"frame_type": "time_stamp", "time_stamp": 9733}, {
335335
"frame_type": "path_ack", "path_id": 0, "ack_delay": 0, "acked_ranges": [[1, 12]]}, {
336-
"frame_type": "path_ack", "path_id": 1, "ack_delay": 0, "acked_ranges": [[0, 0]]}, {
337336
"frame_type": "padding"}]}],
338337
[76910, 0, "transport", "packet_sent", { "packet_type": "1RTT", "header": { "packet_size": 39, "packet_number": 15, "dcid": "0908070605040302" }, "frames": [{
339338
"frame_type": "time_stamp", "time_stamp": 9613}, {

0 commit comments

Comments
 (0)