Commit Graph

64 Commits

Author SHA1 Message Date
Sean McArthur
5da17df97f chore(lib): individually disable tests and examples that aren't updated 2019-07-12 13:44:03 -07:00
Sean McArthur
4441372121 feat(body): require Sync when wrapping a dynamic Stream 2019-07-10 16:49:21 -07:00
Sean McArthur
ccc7c25334 chore(body): re-enable Body::wrap_stream 2019-07-10 14:17:36 -07:00
Sean McArthur
8f4b05ae78 feat(lib): update to std::future::Future
BREAKING CHANGE: All usage of async traits (`Future`, `Stream`,
`AsyncRead`, `AsyncWrite`, etc) are updated to newer versions.
2019-07-09 15:55:22 -07:00
Sean McArthur
da9b0319ef refactor(lib): update to 2018 edition 2019-07-09 15:16:01 -07:00
Sean McArthur
01c03db7ea chore(lib): add dyn keyword to trait objects (#1820)
Requires Rust 1.27.
2019-06-03 13:08:13 -07:00
Lucio Franco
2d9f3490aa feat(body): implement http_body::Body for hyper::Body
This adds a `http_body::Body` impl for hypers `Body`. This should
allow us to start moving to a more generic body trait based on
`BufStream` and `http-body`.
2019-05-16 14:21:42 -07:00
Sean McArthur
7fde9ba6b8 refactor(body): improve Debug format of Body 2019-04-30 14:40:21 -07:00
João Oliveira
8d70baca61 feat(server): impl Sink for Body::Sender
Closes #1781
2019-04-10 10:03:12 -07:00
Josh Leeb-du Toit
9a28268b98 feat(http2): Add content_length() value to incoming h2 Body
- Add `Body::Kind::H2` to contain the content length of the body.
- Update `Body::content_length` to return the content length if `Body::Kind` is `H2`, instead of returning `None`.

Reference: #1556, #1557

Closes #1546
2018-06-18 11:50:12 -07:00
Sean McArthur
fea29b29e2 feat(http1): Add higher-level HTTP upgrade support to Client and Server (#1563)
- Adds `Body::on_upgrade()` that returns an `OnUpgrade` future.
- Adds `hyper::upgrade` module containing types for dealing with
  upgrades.
- Adds `server::conn::Connection::with_upgrades()` method to enable
  these upgrades when using lower-level API (because of a missing
  `Send` bound on the transport generic).
- Client connections are automatically enabled.
- Optimizes request parsing, to make up for extra work to look for
  upgrade requests.
  - Returns a smaller `DecodedLength` type instead of the fatter
    `Decoder`, which should also allow a couple fewer branches.
  - Removes the `Decode::Ignore` wrapper enum, and instead ignoring
    1xx responses is handled directly in the response parsing code.

Ref #1563 

Closes #1395
2018-06-14 13:39:29 -07:00
Laurențiu Nicola
a0a0fcdd9b feat(body): make Body know about incoming Content-Length
When getting a `Body` from hyper, such as in a client response,
the method `Body::content_length()` now returns a value if the header
was present.

Closes #1545
2018-06-08 13:00:46 -07:00
Steven Fackler
a096799c1b feat(body): add Sender::abort
This allows a client or server to indicate that the body should be cut off
in an abnormal fashion so the server doesn't simply get a "valid" but
truncated body.
2018-06-05 17:09:31 -07:00
Sean McArthur
789c2231f3 refactor(body): separate body, payload, and chunk into their own internal mods 2018-06-01 11:22:16 -07:00