Methods added to `Client` and `Server` to control read and write
timeouts of the underlying socket.
Keep-Alive is re-enabled by default on the server, with a default
timeout of 5 seconds.
BREAKING CHANGE: This adds 2 required methods to the `NetworkStream`
trait, `set_read_timeout` and `set_write_timeout`. Any local
implementations will need to add them.
In 53bba6e , ssl usage was improved. The existing benchmark
implementation wasn't adjusted though.
This commit fixes the client benchmark to work with the latest nightly
rust and instructs travis to try compile the benchmarks
when rustc nightly is used. This should prevent such kind of breakage
in future.
Header::parse_header() returns now a hyper Result instead of an option
this will enable more precise Error messages in the future, currently
most failures are reported as ::Error::Header.
BREAKING CHANGE: parse_header returns Result instead of Option, related
code did also change
BREAKING CHANGE: Any custom Connectors will need to change to &self in
the connect method. Any Connectors that needed the mutablity need to
figure out a synchronization strategy.
Request::with_connector() takes a &NetworkConnector instead of &mut.
Any uses of with_connector will need to change to passing &C.
The commit includes an implementation of the new trait method for all
existing trait impls.
BREAKING CHANGE: Adding a new required method to a public trait is a
breaking change.
The errors from openssl were previously boxed into a
Box<std::error::Error>, which lost some specifics and made it difficult
to match against. To solve this, an `Ssl` variant is added to the
`Error` enum of hyper, and is returned when openssl returns specific
errors.
Closes#483
BREAKING CHANGE: Adds a variant to `hyper::Error`, which may break any
exhaustive matches.
BREAKING CHANGE: added requirement that all HeaderFormat implementations
must also be fmt::Debug. This likely as easy as slapping
#[derive(Debug)] on to any custom headers.
All instances of `old_io` and `old_path` were switched to use the new
shiny `std::io`, `std::net`, and `std::path` modules. This means that
`Request` and `Response` implement `Read` and `Write` now.
Because of the changes to `TcpListener`, this also takes the opportunity
to correct the method usage of `Server`. As with other
languages/frameworks, the server is first created with a handler, and
then a host/port is passed to a `listen` method. This reverses what
`Server` used to do.
Closes#347
BREAKING CHANGE: Check the docs. Everything was touched.
It is no longer required, as we can use `<H as Header>::header_name()`.
BREAKING CHANGE: Implementations of Header will need to adjust the
header_name method. It no longer takes any arguments.
- Some stray deriving -> derive changes
- use::{mod} -> use::{self}
- fmt.write -> fmt.write_str
This does not catch the last case of fmt.write_str in the
Show impl of a Header Item. This will need to be changed
separately.
- Includes ergonomic traits like IntoUrl and IntoBody, allowing easy
usage.
- Client can have a RedirectPolicy.
- Client can have a SslVerifier.
Updated benchmarks for client. (Disabled rust-http client bench since it
hangs.)
Instead, you can use an instance of a NetworkConnector with
`Request::with_connector`. This allows overloading of the NetworkStream
constructors, so that it is easy to modify how an `HttpStream` is
created, while still relying on the rest of the stream implementation.
BREAKING CHANGE
Internals have been shuffled around such that Request and Reponse are
now given only a mutable reference to the stream, instead of being
allowed to consume it. This allows the server to re-use the streams if
keep-alive is true.
A task pool is used, and the number of the threads can currently be
adjusted by using the `listen_threads()` method on Server.
[breaking-change]
Intertwining was a nice feature, but it slows down hyper significantly,
so it is being removed.
There is some fallout from this, mainly that Incoming has had its type
parameter changed to `<A = HttpAcceptor>` and Handler receiving one
bounded with `A: NetworkAcceptor`.
[breaking-change]
Fixes#112
A connection is returned from Incoming.next(), and can be passed to a
separate thread before any parsing happens. Call conn.open() to get a
Result<(Request, Response)>.
BREAKING CHANGE
Latest 0.13.0-nightly gives this:
warning: static constant `phrase` should have an uppercase name such as
`PHRASE`, #[warn(non_upper_case_globals)] on by default
The client Request now uses the same system as a server Response to track
the write status of headers, and the API has been updated accordingly.
Additionally, the Request constructors have been moved onto the Request object
instead of being top-level hyper functions, as this better namespaces the
client and Server.
Trying to default the type parameters leads to an ICE and strange type errors.
I think this is just due to the experimental state of default type params and
this change can be rolled back when they are fixed.
The client benchmarks did not have to be changed at all for this whole
refactor, and the server benchmark only had to specify a single type parameter,
and only because it writes out the type of Listener, which is not normal
usage.
Adds a benchmark for testing the speed of hyper's server.
Due to limitations of rust-http, `cargo bench` now needs to be
killed after running because there is no way to kill a rust-http
server after you start it.