kazu-yamamoto / quic

IETF QUIC library in Haskell
BSD 3-Clause "New" or "Revised" License
91 stars 12 forks source link

fix recvStream hanging #54

Closed bjin closed 1 year ago

bjin commented 1 year ago

If RESET_STREAM frame arrives after recvStream started pulling from RecvStreamQ (takeRecvStreamQ call in takeRecvStreamQwithSize), recvStream will hang indefinitely (until being killed by thread manager).

Fix this by pushing a pseudo FIN (empty bytestring) to RecvStreamQ.

bjin commented 1 year ago

I added two tests, simulating both cases that client/server stop the stream first.

Here client or server stop the stream by first sending STOP_SENDING followed by RESET_STREAM. This is how Chrome performs stream closing while keeping connection opened.

Without the fix, both test will fail (hang indefinitely).

kazu-yamamoto commented 1 year ago

Rebased and merged. Thank you for your contribution! I will make a new release tomorrow.

bjin commented 1 year ago

Thanks!