pub enum H2FinalizeTarget {
Done(MuxResult),
Flush,
SkipFlush,
}Expand description
What ConnectionH2::finalize_write wants its caller to do before it may
call ConnectionH2::finalize_write_after_flush.
H2WriteTarget::Finalize’s own two-call protocol, built the way
H2ReadTarget builds the read’s: the core answers a step, the shell
performs the socket work, and the core is told what the socket then said.
The step here is the TLS flush triple — read
H2Shell::tls_wants_write, perform or skip
H2Shell::flush_tls_records, read it again — whose middle is the
only action of the three TLS seams and therefore the one place this pass
has to invert control rather than take a value in.
Self::Flush and Self::SkipFlush are two variants rather than one
boolean because h2_close::finalize_action already distinguishes them:
they differ only in the middle step and share the whole of what follows.
Variants§
Done(MuxResult)
The pre-flush decision ended the pass: the RFC 9113 §6.8 graceful
GOAWAY, or one of the four readiness answers taken while rustls holds
nothing. No flush and no ConnectionH2::finalize_write_after_flush
— this is the pass’s result.
Flush
rustls holds records and this pass wrote nothing: perform
H2Shell::flush_tls_records, read
H2Shell::tls_wants_write again, and answer with
ConnectionH2::finalize_write_after_flush.
SkipFlush
rustls holds records but socket_write_vectored already attempted this
pass’s flush as a side effect: read H2Shell::tls_wants_write
again WITHOUT spending a second empty-buffer write on it, and answer
with ConnectionH2::finalize_write_after_flush.
That second read is not a repeat of the first even on this branch: the vectored writes the pass already made are what may have changed the answer.