Skip to content

Commit

Permalink
remove those sent to avoid unnecessary retransmission
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed Dec 23, 2024
1 parent c9cc65e commit c52800e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
11 changes: 2 additions & 9 deletions include/quicly/remote_cid.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,9 @@ int quicly_remote_cid_unregister(quicly_remote_cid_set_t *set, uint64_t sequence
*/
int quicly_remote_cid_push_retired(quicly_remote_cid_set_t *set, uint64_t sequence);
/**
* flushes the retire queue
* removed the first `count` sequence numbers from the retired queue
*/
static void quicly_remote_cid_clear_retired(quicly_remote_cid_set_t *set);

/* inline definitions */

inline void quicly_remote_cid_clear_retired(quicly_remote_cid_set_t *set)
{
set->retired.count = 0;
}
void quicly_remote_cid_shift_retired(quicly_remote_cid_set_t *set, size_t count);

#ifdef __cplusplus
}
Expand Down
9 changes: 6 additions & 3 deletions lib/quicly.c
Original file line number Diff line number Diff line change
Expand Up @@ -5201,12 +5201,15 @@ static int send_other_control_frames(quicly_conn_t *conn, quicly_send_context_t
}

{ /* RETIRE_CONNECTION_ID */
for (size_t i = 0; i < conn->super.remote.cid_set.retired.count; ++i) {
size_t i;
for (i = 0; i < conn->super.remote.cid_set.retired.count; ++i) {
uint64_t sequence = conn->super.remote.cid_set.retired.cids[i];
if ((ret = send_retire_connection_id(conn, s, sequence)) != 0)
return ret;
break;
}
quicly_remote_cid_clear_retired(&conn->super.remote.cid_set);
quicly_remote_cid_shift_retired(&conn->super.remote.cid_set, i);
if (ret != 0)
return ret;
}

return 0;
Expand Down

0 comments on commit c52800e

Please sign in to comment.