fix(webrtc): preserve read half on STOP_SENDING frames - #6577
Conversation
|
Besides, webrtc releases 0.20, can you also update webrtc in this pr? |
Thanks for the heads-up. I tried updating Besides the removal of the More importantly, the current libp2p WebRTC Direct transport relies on a custom UDP mux through Would you prefer to keep this bug-fix PR focused and track the 0.20 migration separately? If the migration should be done in this PR, could you point me to the intended replacement for the custom UDP mux and detached data-channel APIs? |
|
https://github.com/getong/rust-libp2p/tree/webrtc-0.20 |
I think you should submit a separate PR to do this. |
|
I am not good at webrtc, you can take a review and copy it . |
I'm just curious, are you the maintainer of this project or something else? |
|
no |
We'd better listen to the advice of the maintainers or members first. |
|
@jxs Hi, would you mind reviewing this WebRTC stream fix? It preserves the read half after STOP_SENDING, reports RESET as ConnectionReset, and delivers a payload before EOF when FIN and data arrive in the same frame. Regression tests cover all three cases. I’m keeping the webrtc-rs 0.20 migration out of this PR because that requires broader transport/API changes and seems better handled separately. Thanks. |
Description
Preserve WebRTC stream half-close semantics when processing control frames.
A payload-less
STOP_SENDINGframe previously causedpoll_readto returnOk(0), incorrectly signaling EOF even thoughSTOP_SENDINGonly closes the local write half. Continue polling for inbound data after handling this flag.Report
RESETasConnectionReseton the first read instead of initially returning normal EOF. When aFINframe carries a payload, deliver the payload before reporting EOF.AI Assistance Disclosure
Tools used (required — write
noneif no AI was used): OpenAI CodexAttestation (required):
Notes & open questions
The protobuf schema permits a flag and payload in the same frame. The implementation therefore delays handling a payload-carrying
FINuntil its payload has been consumed.RESETremains immediate and discards its payload.Change checklist