Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve handling of CID retirement #576

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ SET(QUICLY_LIBRARY_FILES
lib/rate.c
lib/recvstate.c
lib/remote_cid.c
lib/retire_cid.c
lib/sendstate.c
lib/sentmap.c
lib/streambuf.c
Expand All @@ -77,7 +76,6 @@ SET(UNITTEST_SOURCE_FILES
t/ranges.c
t/rate.c
t/remote_cid.c
t/retire_cid.c
t/sentmap.c
t/simple.c
t/stream-concurrency.c
Expand Down
25 changes: 20 additions & 5 deletions include/quicly/remote_cid.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ typedef struct st_quicly_remote_cid_set_t {
* we expect to receive CIDs with sequence number smaller than or equal to this number
*/
uint64_t _largest_sequence_expected;
/**
* queue containing CID sequence numbers that should be sent using RETIRE_CONNECTION_ID frames
*/
struct {
uint64_t cids[QUICLY_LOCAL_ACTIVE_CONNECTION_ID_LIMIT * 2];
size_t count;
} retired;
} quicly_remote_cid_set_t;

/**
Expand All @@ -93,16 +100,24 @@ typedef struct st_quicly_remote_cid_set_t {
*/
void quicly_remote_cid_init_set(quicly_remote_cid_set_t *set, ptls_iovec_t *initial_cid, void (*random_bytes)(void *, size_t));
/**
* registers received connection ID
* registers received connection ID at the same time pushing CIDs to the retired queue, if any
* returns 0 if successful (registered or ignored because of duplication/stale information), transport error code otherwise
*/
int quicly_remote_cid_register(quicly_remote_cid_set_t *set, uint64_t sequence, const uint8_t *cid, size_t cid_len,
const uint8_t srt[QUICLY_STATELESS_RESET_TOKEN_LEN], uint64_t retire_prior_to,
uint64_t unregistered_seqs[QUICLY_LOCAL_ACTIVE_CONNECTION_ID_LIMIT], size_t *num_unregistered_seqs);
const uint8_t srt[QUICLY_STATELESS_RESET_TOKEN_LEN], uint64_t retire_prior_to);
/**
* Unregisters specified CID from the store, pushing the unregistered CID onto the retired queue. The former always succeeds, while
* the latter might fail due to overflow. In case of the latter, an error is returned.
*/
int quicly_remote_cid_unregister(quicly_remote_cid_set_t *set, uint64_t sequence);
/**
* pushes a CID sequence number to the retired queue
*/
int quicly_remote_cid_push_retired(quicly_remote_cid_set_t *set, uint64_t sequence);
/**
* unregisters specified CID from the store
* removed the first `count` sequence numbers from the retired queue
*/
void quicly_remote_cid_unregister(quicly_remote_cid_set_t *set, uint64_t sequence);
void quicly_remote_cid_shift_retired(quicly_remote_cid_set_t *set, size_t count);

#ifdef __cplusplus
}
Expand Down
64 changes: 0 additions & 64 deletions include/quicly/retire_cid.h

This file was deleted.

Loading
Loading