Skip to content

fix(http3): treat STOP_SENDING with code 0 as benign stop-sending - #3152

Open
aloneangel45 wants to merge 1 commit into
seanmonstar:masterfrom
aloneangel45:fix/3147-h3-stop-sending-zero
Open

aloneangel45 wants to merge 1 commit into
seanmonstar:masterfrom
aloneangel45:fix/3147-h3-stop-sending-zero

Conversation

@aloneangel45

Copy link
Copy Markdown

Summary

When an HTTP/3 server drops an unread request receive stream (e.g. quinn::RecvStream::drop), QUIC emits STOP_SENDING with wire error code x0 rather than H3_NO_ERROR (x100). Previously h3_client::pool::is_stop_sending only matched Code::H3_NO_ERROR, causing send.send_data() / send.finish() to fail the exchange with StreamError::RemoteTerminate { code: 0x0 }.

Changes

  • Updated is_stop_sending in src/async_impl/h3_client/pool.rs to also accept code == 0 alongside Code::H3_NO_ERROR, while still propagating real HTTP/3 error codes such as Code::H3_INTERNAL_ERROR.
  • Added http3_test_h3_stop_sending_before_response_zero_code_request_body in ests/http3.rs.

Verification

Ran locally (RUSTFLAGS="--cfg reqwest_unstable"):

cargo fmt --check
cargo +stable-x86_64-pc-windows-gnullvm test --features http3,stream --test http3
cargo +stable-x86_64-pc-windows-gnullvm test --features http3,stream --lib

10/10 tests in ests/http3.rs passed and 48/48 lib unit tests passed.

Fixes #3147

When a peer using quinn drops its unread receive half without calling
stop_sending(H3_NO_ERROR), QUIC sends STOP_SENDING with error code 0x0.
Update h3_client::pool::is_stop_sending to treat code 0 as benign
alongside Code::H3_NO_ERROR while still propagating HTTP/3 errors such as
H3_INTERNAL_ERROR.

Fixes seanmonstar#3147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http3: STOP_SENDING with code 0 from the server fails the exchange (RemoteTerminate { code: 0x0 })

1 participant