This adds a dependency on the time crate found in rust-lang/time
and fixes a field rename from tm_gmtoff to tm_utcoff.
add time dependency
tm_gmtoff has been renamed to tm_utcoff
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
Also adds an EmptyWriter, used for GET and HEAD requests,
which will return an io::ShortWrite error if the user ever tries
to write to a GET or HEAD request.
Closes#77
An Authorization header contains a Scheme. If you have no real scheme,
you can use String as your scheme (Authorization<String>).
This includes the `Basic` scheme built-in.
Header contains all of the trait-object unsafe methods
including the name of the header and parsing. HeaderFormat
contains fmt_header, which is the only trait-object safe
method.
Internal representation was changed from an enum back to a Struct again.
The raw representation *has* to stick around, even if parsed as a proper
typed header. The reason is that internally, hyper will access some
headers to know which parts of the http protocol to follow (such as if
the response has a length or is chunked). The raw value may still be
needed afterwards, such as for a DOM binding of
.getAllResponseHeaders().
Since the raw is kept around, the unsafety of get_raw is no longer true,
and so that is removed.
It's still more ergonomic to access the types, and safer as well, so
that is recommended when possible.
The old parser used a manually unrolled state machine
and was broken due to upstream rust issues with match
statements.
The new parser is a read into a stack-allocated buffer
followed by a single match on the contents of that
buffer.
This significantly improves the benchmarks for method
reads by almost 30%, in addition to working around
the upstream rust issues with reordering match blocks.