private-octopus / picoquic

Minimal implementation of the QUIC protocol
MIT License
523 stars 153 forks source link

Schedule retransmission based on stream priorities #1586

Closed huitema closed 7 months ago

huitema commented 7 months ago

Datagrams, new stream data and retransmission of lost packets compete for bandwidth and for scheduling slots. This PR modifies the scheduling of the packets to heed the priority of each stream, and compare it to the priority of datagrams, which is arbitrarily set to the value 9, same as the default priority of streams.

Close #1583

huitema commented 7 months ago

The issue detected by the address sanitizer is not related to the retransmission priority fixes. It probably happens now because the packet schedule changed a little bit, causing the condition where a packet contains two consecutive frames for the same stream. The algorithm then tries to "pack" those data together. The sanitizer is correct, this requires using "memmove" rather than "memcpy". Tests pass after that fix.