diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2025-03-10 19:42:22 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2025-03-10 19:56:23 +0300 |
commit | fc6cd7d48282fba73b60215b3fd31fc0a8825982 (patch) | |
tree | bcb36b06098e700fd726b6b19c89e6fae7d429e2 /contrib/libs/ngtcp2/lib/ngtcp2_gaptr.c | |
parent | 21c1cc59ef7d0910313ef39ca737c78380ef3ec3 (diff) | |
download | ydb-fc6cd7d48282fba73b60215b3fd31fc0a8825982.tar.gz |
Update contrib/libs/ngtcp2 to 1.11.0
commit_hash:3beea54841aa142a4af33f802d5bdb7d6010b68d
Diffstat (limited to 'contrib/libs/ngtcp2/lib/ngtcp2_gaptr.c')
-rw-r--r-- | contrib/libs/ngtcp2/lib/ngtcp2_gaptr.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/contrib/libs/ngtcp2/lib/ngtcp2_gaptr.c b/contrib/libs/ngtcp2/lib/ngtcp2_gaptr.c index 3bfa398480..d04b9634c2 100644 --- a/contrib/libs/ngtcp2/lib/ngtcp2_gaptr.c +++ b/contrib/libs/ngtcp2/lib/ngtcp2_gaptr.c @@ -35,7 +35,9 @@ void ngtcp2_gaptr_init(ngtcp2_gaptr *gaptr, const ngtcp2_mem *mem) { } static int gaptr_gap_init(ngtcp2_gaptr *gaptr) { - ngtcp2_range range = {0, UINT64_MAX}; + ngtcp2_range range = { + .end = UINT64_MAX, + }; return ngtcp2_ksl_insert(&gaptr->gap, NULL, &range, NULL); } @@ -50,7 +52,11 @@ void ngtcp2_gaptr_free(ngtcp2_gaptr *gaptr) { int ngtcp2_gaptr_push(ngtcp2_gaptr *gaptr, uint64_t offset, uint64_t datalen) { int rv; - ngtcp2_range k, m, l, r, q = {offset, offset + datalen}; + ngtcp2_range k, m, l, r; + ngtcp2_range q = { + .begin = offset, + .end = offset + datalen, + }; ngtcp2_ksl_it it; if (ngtcp2_ksl_len(&gaptr->gap) == 0) { @@ -110,11 +116,16 @@ uint64_t ngtcp2_gaptr_first_gap_offset(const ngtcp2_gaptr *gaptr) { ngtcp2_range ngtcp2_gaptr_get_first_gap_after(const ngtcp2_gaptr *gaptr, uint64_t offset) { - ngtcp2_range q = {offset, offset + 1}; + ngtcp2_range q = { + .begin = offset, + .end = offset + 1, + }; ngtcp2_ksl_it it; if (ngtcp2_ksl_len(&gaptr->gap) == 0) { - ngtcp2_range r = {0, UINT64_MAX}; + ngtcp2_range r = { + .end = UINT64_MAX, + }; return r; } @@ -128,7 +139,10 @@ ngtcp2_range ngtcp2_gaptr_get_first_gap_after(const ngtcp2_gaptr *gaptr, int ngtcp2_gaptr_is_pushed(const ngtcp2_gaptr *gaptr, uint64_t offset, uint64_t datalen) { - ngtcp2_range q = {offset, offset + datalen}; + ngtcp2_range q = { + .begin = offset, + .end = offset + datalen, + }; ngtcp2_ksl_it it; ngtcp2_range m; @@ -138,6 +152,9 @@ int ngtcp2_gaptr_is_pushed(const ngtcp2_gaptr *gaptr, uint64_t offset, it = ngtcp2_ksl_lower_bound_search(&gaptr->gap, &q, ngtcp2_ksl_range_exclusive_search); + + assert(!ngtcp2_ksl_it_end(&it)); + m = ngtcp2_range_intersect(&q, (ngtcp2_range *)ngtcp2_ksl_it_key(&it)); return ngtcp2_range_len(&m) == 0; |