Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,23 @@
//! # Cancel safety
//!
//! Futures returned by hyper are cancel safe: dropping a future before it
//! completes is the supported way to cancel the operation. See the
//! documentation on individual futures — for example `SendRequest::send_request`
//! in `client::conn::http1` and `client::conn::http2` — for the protocol-
//! specific behavior on cancellation.
//! completes is the supported way to cancel the operation. The protocol in
//! use changes what that cancellation actually does on the wire:
//!
//! - **HTTP/1** has no in-protocol way to abort a single request without
//! affecting the shared connection, so dropping an in-flight request future
//! closes the underlying TCP connection. Any subsequent call on the same
//! `SendRequest` returns a `canceled` error; the connection cannot be
//! reused.
//! - **HTTP/2** resets the single stream with `RST_STREAM` (`CANCEL` error
//! code) and notifies the peer immediately rather than continuing to
//! deliver a response body that would be discarded. The shared connection
//! stays usable for other in-flight and future requests.
//!
//! See the documentation on individual futures — for example
//! `SendRequest::send_request` in `client::conn::http1` and the equivalent
//! in `client::conn::http2` — for the protocol-specific behavior on
//! cancellation.
//!
//! # Optional Features
//!
Expand Down