aiortc / aioquic

QUIC and HTTP/3 implementation in Python
BSD 3-Clause "New" or "Revised" License
1.65k stars 234 forks source link

Possible mistake when handling a duplicate frame #134

Closed arut closed 3 years ago

arut commented 4 years ago

I've been looking at interop failures of auiquic + nginx and found what could be the reason of it. When a duplicate frame is handled in add_frame(), the count does not get decreased, which may further lead to cutting a part of the buffer at the front.

Handling an old frame: https://github.com/aiortc/aioquic/blob/919ccec9836bf5fa4329b5b050604b09f71d0bdc/src/aioquic/quic/stream.py#L82

Cutting the buffer: https://github.com/aiortc/aioquic/blob/919ccec9836bf5fa4329b5b050604b09f71d0bdc/src/aioquic/quic/stream.py#L95

jlaine commented 3 years ago

Thanks for this, this looks like the likely root cause for #128. I will try to look at this at the latest over the weekend