Release 2.24.5

- [FEATURE] Improve Delayed ACKs extension and turn it on by default.
- Limit receive history to a finite amount of memory.
This commit is contained in:
Dmitri Tikhonov 2020-11-24 08:51:36 -05:00
parent 8e6b1576b4
commit f38b395a31
21 changed files with 525 additions and 113 deletions

View file

@ -30,7 +30,7 @@ test1 (void) /* Inverse of quic_framer_test.cc -- NewAckFrameOneAckBlock */
lsquic_time_t now = lsquic_time_now();
lsquic_packno_t largest = 0;
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
unsigned i;
for (i = 1; i <= 0x1234; ++i)
@ -69,7 +69,7 @@ test2 (void) /* Inverse of quic_framer_test.cc -- NewAckFrameOneAckBlock, minus
lsquic_rechist_t rechist;
lsquic_time_t now = lsquic_time_now();
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
/* Encode the following ranges:
* high low
@ -128,7 +128,7 @@ test3 (void)
lsquic_rechist_t rechist;
lsquic_time_t now = lsquic_time_now();
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
/* Encode the following ranges:
* high low
@ -174,7 +174,7 @@ test4 (void)
lsquic_rechist_t rechist;
int i;
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
lsquic_time_t now = lsquic_time_now();
lsquic_rechist_received(&rechist, 1, now);
@ -244,7 +244,7 @@ test_4byte_packnos (void)
lsquic_rechist_t rechist;
lsquic_time_t now = lsquic_time_now();
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
packno = 0x23456789;
(void) lsquic_rechist_received(&rechist, packno - 33, now);

View file

@ -343,7 +343,7 @@ test_max_ack (void)
unsigned char buf[1500];
struct ack_info acki;
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
now = lsquic_time_now();
for (i = 1; i <= 300; ++i)
@ -396,7 +396,7 @@ test_ack_truncation (void)
struct ack_info acki;
size_t bufsz;
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
now = lsquic_time_now();
for (i = 1; i <= 300; ++i)

View file

@ -34,7 +34,7 @@ test_max_ack (void)
unsigned char buf[1500];
struct ack_info acki;
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
now = lsquic_time_now();
for (i = 1; i <= 300; ++i)
@ -87,7 +87,7 @@ test_ack_truncation (void)
struct ack_info acki;
size_t bufsz;
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
now = lsquic_time_now();
for (i = 1; i <= 300; ++i)

View file

@ -21,7 +21,7 @@ test4 (void)
const struct lsquic_packno_range *range;
lsquic_packno_t packno;
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
for (packno = 11917; packno <= 11941; ++packno)
lsquic_rechist_received(&rechist, packno, 0);
@ -122,7 +122,7 @@ test5 (void)
lsquic_rechist_t rechist;
char buf[100];
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
lsquic_rechist_received(&rechist, 1, 0);
/* Packet 2 omitted because it could not be decrypted */
@ -165,15 +165,15 @@ test5 (void)
static void
test_rand_sequence (unsigned seed)
test_rand_sequence (unsigned seed, unsigned max)
{
struct lsquic_rechist rechist;
const struct lsquic_packno_range *range;
lsquic_packno_t prev_low;
enum received_st st;
unsigned i;
unsigned i, count;
lsquic_rechist_init(&rechist, 1);
lsquic_rechist_init(&rechist, 1, max);
srand(seed);
for (i = 0; i < 10000; ++i)
@ -186,13 +186,17 @@ test_rand_sequence (unsigned seed)
assert(range);
assert(range->high >= range->low);
prev_low = range->low;
count = 1;
while (range = lsquic_rechist_next(&rechist), range != NULL)
{
++count;
assert(range->high >= range->low);
assert(range->high < prev_low);
prev_low = range->low;
}
if (max)
assert(count <= max);
lsquic_rechist_cleanup(&rechist);
}
@ -226,7 +230,7 @@ test_shuffle_1000 (unsigned seed)
struct shuffle_elem *els;
els = malloc(sizeof(els[0]) * 10000);
lsquic_rechist_init(&rechist, 1);
lsquic_rechist_init(&rechist, 1, 0);
srand(seed);
for (i = 0; i < 10000; ++i)
@ -263,7 +267,7 @@ main (void)
unsigned i;
const struct lsquic_packno_range *range;
lsquic_rechist_init(&rechist, 0);
lsquic_rechist_init(&rechist, 0, 0);
lsquic_time_t now = 1234;
st = lsquic_rechist_received(&rechist, 0, now);
@ -356,7 +360,10 @@ main (void)
test5();
for (i = 0; i < 10; ++i)
test_rand_sequence(i);
test_rand_sequence(i, 0);
for (i = 0; i < 10; ++i)
test_rand_sequence(i, 111 + i * 3 /* Just something arbitrary */);
for (i = 0; i < 10; ++i)
test_shuffle_1000(i);