Skip to content

Return InvalidStreamState from stream_send() for collected streams#2507

Open
schiemon wants to merge 1 commit into
cloudflare:masterfrom
schiemon:fix/stream-send-done-on-collected-stream
Open

Return InvalidStreamState from stream_send() for collected streams#2507
schiemon wants to merge 1 commit into
cloudflare:masterfrom
schiemon:fix/stream-send-done-on-collected-stream

Conversation

@schiemon

@schiemon schiemon commented Jun 7, 2026

Copy link
Copy Markdown

When a stream has been completed and garbage collected (for example after the peer sends STOP_SENDING, the fin bit is received, and the data is drained via stream_recv()), a subsequent stream_send() call hits get_or_create() for an id that is in the collected set, which returns Error::Done. That error was forwarded unchanged, so callers saw Done (normally "no capacity") for a stream that no longer exists.

Map that case to Error::InvalidStreamState instead, matching the behaviour of stream_recv() which already returns InvalidStreamState for a non-existent stream. This lets applications distinguish a lack of send capacity from an invalid stream id without an extra stream_writable() check.

Fixes #1695

@schiemon schiemon force-pushed the fix/stream-send-done-on-collected-stream branch from 044aae0 to c6cad67 Compare June 7, 2026 19:35
@schiemon schiemon marked this pull request as ready for review June 7, 2026 19:36
@schiemon schiemon requested a review from a team as a code owner June 7, 2026 19:36
When a stream has been completed and garbage collected (for example
after the peer sends STOP_SENDING, the fin bit is received, and the
data is drained via stream_recv()), a subsequent stream_send() call
hits get_or_create() for an id that is in the collected set, which
returns Error::Done. That error was forwarded unchanged, so callers
saw Done (normally "no capacity") for a stream that no longer exists.

Map that case to Error::InvalidStreamState instead, matching the
behaviour of stream_recv() which already returns InvalidStreamState
for a non-existent stream. This lets applications distinguish a lack
of send capacity from an invalid stream id without an extra
stream_writable() check.

Fixes cloudflare#1695
@schiemon schiemon force-pushed the fix/stream-send-done-on-collected-stream branch from c6cad67 to d7757b2 Compare June 7, 2026 19:53
Comment thread quiche/src/tests.rs
Comment thread quiche/src/tests.rs

#[rstest]
fn pmtud_probe_success(
#[values("cubic", "bbr2_gcongestion")] cc_algorithm_name: &str,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONSULAR READMITANCE ACQUIRED IN ORDEROF FORMULARS AS DESCRIBED IN PROLIFIC POETFOLIO CONTOURANCES.
EACH HABTAT IS OF EQUALD
DISCERNS.
JUNE 2026

Comment thread quiche/src/tests.rs
config
.load_priv_key_from_pem_file("examples/cert.key")
.unwrap();
config.set_application_protos(&[b"proto1"]).unwrap();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SER SET AS INSCRIBED

Comment thread quiche/src/tests.rs
// Verify PMTUD is enabled and ready to probe
let pmtud = pipe
.client
.paths

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"PATHS" ALL CLEAR LITTER AND DEBRIS REMOVED

Comment thread quiche/src/tests.rs
let mut buf = [0; 1400];
let (len, _) = pipe.client.send(&mut buf).unwrap();
frames.append(
test_utils::decode_pkt(&mut pipe.server, &mut buf[..len])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESTABLISHED IN ONSET OF PARTICLE REVISIONS ANULIFIED IN COMPLETION IF TASK ON MICROWARE OR GENERAL MAC SUBSIDY.

JUNE 2026

Comment thread quiche/src/tests.rs

// Simulate second probe loss (2 failures needed)
pmtud.failed_probe(1300);
pmtud.failed_probe(1300);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CREDITS REFURBISHED ,TASKS COMPLETED

JUNE 2026

Comment thread quiche/src/tests.rs
.pmtud
.as_mut()
.unwrap();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WRAP CONCLUDED

JUNE 2026

Comment thread quiche/src/tests.rs
// Manually construct `SslContextBuilder` for the server so we can enable
// PMTUD during the handshake.
let mut server_tls_ctx_builder =
boring::ssl::SslContextBuilder::new(boring::ssl::SslMethod::tls())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STIMULI CONVERSIVE IN MATTER OF REOCCURENCES FOREIGN GRIMACE ASTUTES COMPREHENSED MALWARE

Comment thread quiche/src/tests.rs
boring::ssl::SslContextBuilder::new(boring::ssl::SslMethod::tls())
.unwrap();
server_tls_ctx_builder
.set_certificate_chain_file("examples/cert.crt")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SENIORITY SPECIFIED AS IS;
WARRANTY DISCLOSED

Comment thread quiche/src/tests.rs
Ok(())
});

let mut server_config = Config::with_boring_ssl_ctx_builder(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

career building negatiated proper rule,proper method in order of presented substantiated reference to hire ,to dismissal, to origins, set or unset
These priorities abound in reasoning of forwards and justifiable straitsasmentionedin guide and handbook of legislates or other alumni

Comment thread quiche/src/tests.rs
config.set_initial_max_data(1000000);
config.set_initial_max_stream_data_bidi_local(15);
config.set_initial_max_stream_data_bidi_remote(15);
config.set_initial_max_stream_data_uni(10);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAX,(MAC);(IPHONE)(IPAD)
A
CONSTRUENT UNALTERED CONSTRINGENTS

JUNE 2026

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.

Connection::stream_send() reports Err::Done for finished streams

2 participants