Skip to content

Commit f6569b4

Browse files
committed
Remove ACK_CTX and PKT_CTX from CID
1 parent b742563 commit f6569b4

File tree

3 files changed

+1
-47
lines changed

3 files changed

+1
-47
lines changed

picoquic/frames.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3060,12 +3060,6 @@ int picoquic_process_ack_of_ack_mp_frame(
30603060
ack_ctx = &cnx->path[path_index]->ack_ctx;
30613061
}
30623062
}
3063-
else {
3064-
picoquic_local_cnxid_t* l_cid = picoquic_find_local_cnxid_by_number(cnx, 0, path_id);
3065-
if (l_cid != NULL) {
3066-
ack_ctx = &l_cid->ack_ctx;
3067-
}
3068-
}
30693063

30703064
if (ack_ctx == NULL) {
30713065
/* skip ack frame */

picoquic/picoquic_internal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,6 @@ typedef struct st_picoquic_local_cnxid_t {
950950
uint64_t sequence;
951951
uint64_t create_time;
952952
picoquic_connection_id_t cnx_id;
953-
picoquic_ack_context_t ack_ctx;
954953
unsigned int is_acked;
955954
} picoquic_local_cnxid_t;
956955

@@ -978,7 +977,6 @@ typedef struct st_picoquic_remote_cnxid_t {
978977
unsigned int needs_removal : 1;
979978
unsigned int retire_sent : 1;
980979
unsigned int retire_acked : 1;
981-
picoquic_packet_context_t pkt_ctx;
982980
} picoquic_remote_cnxid_t;
983981

984982
typedef struct st_picoquic_remote_cnxid_stash_t {

picoquic/quicctx.c

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,7 +2448,6 @@ int picoquic_init_cnxid_stash(picoquic_cnx_t* cnx)
24482448
else {
24492449
memset(remote_cnxid_stash->cnxid_stash_first, 0, sizeof(picoquic_remote_cnxid_t));
24502450
remote_cnxid_stash->cnxid_stash_first->nb_path_references++;
2451-
picoquic_init_packet_ctx(cnx, &remote_cnxid_stash->cnxid_stash_first->pkt_ctx, picoquic_packet_context_application);
24522451

24532452
/* Initialize the reset secret to a random value. This
24542453
* will prevent spurious matches to an all zero value, for example.
@@ -2532,7 +2531,6 @@ uint64_t picoquic_add_remote_cnxid_to_stash(picoquic_cnx_t* cnx, picoquic_remote
25322531
memset(stashed, 0, sizeof(picoquic_remote_cnxid_t));
25332532
(void)picoquic_parse_connection_id(cnxid_bytes, cid_length, &stashed->cnx_id);
25342533
stashed->sequence = sequence;
2535-
picoquic_init_packet_ctx(cnx, &stashed->pkt_ctx, picoquic_packet_context_application);
25362534
memcpy(stashed->reset_secret, secret_bytes, PICOQUIC_RESET_SECRET_SIZE);
25372535
stashed->next = NULL;
25382536

@@ -2597,39 +2595,6 @@ picoquic_remote_cnxid_t* picoquic_remove_cnxid_from_stash(picoquic_cnx_t* cnx, p
25972595
}
25982596
/* Actually remove the element from the stash */
25992597
if (stashed != NULL) {
2600-
picoquic_packet_context_t* pkt_ctx = &removed->pkt_ctx;
2601-
2602-
if (recycle_packets) {
2603-
picoquic_packet_t* recycled = pkt_ctx->pending_first;
2604-
while (recycled != NULL) {
2605-
picoquic_packet_t * recycled_previous = recycled->packet_next;
2606-
int packet_is_pure_ack = 0;
2607-
int do_not_detect_spurious = 0;
2608-
int add_to_data_repeat_queue = 0;
2609-
size_t length = 0;
2610-
int ret = picoquic_copy_before_retransmit(recycled, cnx, NULL, 0, &packet_is_pure_ack,
2611-
&do_not_detect_spurious, 1, &length, &add_to_data_repeat_queue);
2612-
if (ret != 0 || length != 0) {
2613-
/* Unexpected! */
2614-
DBG_PRINTF("Recycle stashed packet returns %d, length %zu\n", ret, length);
2615-
}
2616-
(void)picoquic_dequeue_retransmit_packet(cnx, pkt_ctx, recycled, 1, add_to_data_repeat_queue);
2617-
recycled = recycled_previous;
2618-
}
2619-
}
2620-
else
2621-
{
2622-
while (pkt_ctx->pending_last != NULL) {
2623-
(void)picoquic_dequeue_retransmit_packet(cnx, pkt_ctx, pkt_ctx->pending_last, 1, 0);
2624-
}
2625-
}
2626-
2627-
while (pkt_ctx->retransmitted_newest != NULL) {
2628-
picoquic_dequeue_retransmitted_packet(cnx, pkt_ctx, pkt_ctx->retransmitted_newest);
2629-
}
2630-
2631-
pkt_ctx->retransmitted_oldest = NULL;
2632-
26332598
stashed = stashed->next;
26342599
if (previous == NULL) {
26352600
remote_cnxid_stash->cnxid_stash_first = stashed;
@@ -3351,7 +3316,7 @@ picoquic_local_cnxid_t* picoquic_create_local_cnxid(picoquic_cnx_t* cnx,
33513316
if (l_cid != NULL) {
33523317
memset(l_cid, 0, sizeof(picoquic_local_cnxid_t));
33533318
l_cid->create_time = current_time;
3354-
picoquic_init_ack_ctx(cnx, &l_cid->ack_ctx);
3319+
33553320
if (cnx->quic->local_cnxid_length == 0) {
33563321
is_unique = 1;
33573322
}
@@ -3435,9 +3400,6 @@ void picoquic_delete_local_cnxid_listed(picoquic_cnx_t* cnx,
34353400
l_cid->registered_cnx = NULL;
34363401
}
34373402

3438-
/* Clear the associated ack context */
3439-
picoquic_clear_ack_ctx(&l_cid->ack_ctx);
3440-
34413403
if (local_cnxid_list != NULL) {
34423404
picoquic_local_cnxid_t* next = local_cnxid_list->local_cnxid_first;
34433405

0 commit comments

Comments
 (0)