Commit Graph

2230 Commits

Author SHA1 Message Date
Sean McArthur
97ed0478a8 refactor(client): replace futures oneshot with tokio in dispatcher 2020-03-25 14:50:51 -07:00
Sean McArthur
e6a6ddef7c refactor(client): replace futures mpsc for tokio mpsc in dispatcher 2020-03-25 14:50:51 -07:00
Sean McArthur
5b3724eeec chore(ci): re-enable minimum rust version (1.39) 2020-03-25 11:33:21 -07:00
Sean McArthur
fce3ddce46 fix(server): fix panic in Connection::graceful_shutdown 2020-03-25 10:28:46 -07:00
Sean McArthur
597cef225e test(body): fix Body size of tests on 32-bit architecture
Closes #2158
2020-03-24 11:56:26 -07:00
Sean McArthur
22fcd66241 v0.13.4 2020-03-20 16:13:44 -07:00
Sean McArthur
9a8413d910 feat(http2): add HTTP2 keep-alive support for client and server
This adds HTTP2 keep-alive support to client and server connections
based losely on GRPC keep-alive. When enabled, after no data has been
received for some configured interval, an HTTP2 PING frame is sent. If
the PING is not acknowledged with a configured timeout, the connection
is closed.

Clients have an additional option to enable keep-alive while the
connection is otherwise idle. When disabled, keep-alive PINGs are only
used while there are open request/response streams. If enabled, PINGs
are sent even when there are no active streams.

For now, since these features use `tokio::time::Delay`, the `runtime`
cargo feature is required to use them.
2020-03-20 14:20:45 -07:00
Sean McArthur
d838d54fdf fix(http1): try to drain connection buffer if user drops Body 2020-03-10 12:57:36 -07:00
Sean McArthur
5b046a1f8f v0.13.3 2020-03-03 15:34:49 -08:00
Sean McArthur
6a1bd055fc refactor(http2): store bdp sampler in Body H2 variant 2020-03-03 14:48:42 -08:00
Sean McArthur
a82fd6c94a feat(client): rename client::Builder pool options (#2142)
- Renamed `keep_alive_timeout` to `pool_idle_timeout`.
- Renamed `max_idle_per_host` to `pool_max_idle_per_host`.
- Deprecated `keep_alive(bool)` due to confusing name. To disable the
  connection pool, call `pool_max_idle_per_host(0)`.
2020-02-27 14:25:06 -08:00
Sean McArthur
48102d6122 feat(http2): add adaptive window size support using BDP (#2138)
This adds support for calculating the Bandwidth-delay product when using
HTTP2. When a DATA frame is received, a PING is sent to the remote.
While the PING acknoledgement is outstanding, the amount of bytes of all
received DATA frames is accumulated. Once we receive the PING
acknowledgement, we calculate the BDP based on the number of received
bytes and the round-trip-time of the PING. If we are near the current
maximum window size, the size is doubled.

It's disabled by default until tested more extensively.
2020-02-25 16:00:50 -08:00
Sean McArthur
22dc6fe4c6 doc(lib): hide error module documentation 2020-02-21 11:49:38 -08:00
Sean McArthur
6b47c69f4a test(http1): add benchmarks for fixed and chunked decoding 2020-02-19 13:43:26 -08:00
Sean McArthur
14fc2d00f1 style(http2): format http2 code 2020-02-19 12:29:59 -08:00
Sean McArthur
cc6b396e65 refactor(h2): change error message when poll capacity is canceled 2020-02-19 11:07:05 -08:00
daxpedda
24d53d3f66 feat(server): add poll_peek to AddrStream (#2127) 2020-02-17 11:31:36 -08:00
Sean McArthur
dd02254ae8 style(lib): apply latest rustfmt 2020-02-06 11:41:25 -08:00
Sean McArthur
141207769f v0.13.2 2020-01-29 12:41:58 -08:00
Sean McArthur
6cf6245741 refactor(client): touch up connect log formats 2020-01-29 12:29:46 -08:00
Sean McArthur
2983395d63 chore(lib): update pretty_env_logger to v0.4 (#2123) 2020-01-29 12:08:43 -08:00
Sean McArthur
dc88204716 fix(body): return exactly 0 SizeHint for empty body (#2122) 2020-01-29 11:55:07 -08:00
Sean McArthur
9d1271384b docs(examples): rename proxy example to gateway 2020-01-29 11:10:48 -08:00
Sean McArthur
5c6536317c docs(examples): improve README for examples directory 2020-01-29 11:09:21 -08:00
Kelly Thomas Kline
086fa359ff docs(readme): Add link to warp (#2081) 2020-01-29 10:26:59 -08:00
Linus Färnstrand
de7418da2f style(lib): use just std instead of ::std in paths (#2101) 2020-01-29 10:25:57 -08:00
Sean McArthur
c4bb4db5c2 fix(http1): only send 100 Continue if request body is polled
Before, if a client request included an `Expect: 100-continue` header,
the `100 Continue` response was sent immediately. However, this is
problematic if the service is going to reply with some 4xx status code
and reject the body.

This change delays the automatic sending of the `100 Continue` status
until the service has call `poll_data` on the request body once.
2020-01-28 17:32:58 -08:00
Sean McArthur
a354580e3f perf(body): reduce memory size of Body by a u64 (#2118)
Replaces the `Option<u64>` content-length with a `DecodedLength`, which
stores its unknown-ness as `u64::MAX`.
2020-01-27 13:09:40 -08:00
Sean McArthur
1881db6391 fix(http1): remove panic for HTTP upgrades that have been ignored (#2115)
Closes #2114
2020-01-23 16:41:40 -08:00
Sean McArthur
ba2a144f8b fix(client): strip path from Uri before calling Connector (#2109) 2020-01-13 11:45:28 -08:00
Markus Westerlind
a5720fab4c feat(service): Implement Clone/Copy on ServiceFn and MakeServiceFn (#2104) 2020-01-08 12:44:07 -08:00
danieleades
0eaf304644 style(lib): address most clippy lints 2020-01-03 09:40:32 -08:00
danieleades
0f13719873 refactor(error): remove deprecated 'Error::description' method (#2092) 2019-12-30 09:55:08 -08:00
guoyunlong16
fb90d30c02 fix(http2): don't add client content-length if method doesn't require it 2019-12-26 10:41:52 -08:00
Vivek Ghaisas
35825c4614 style(comments): correct some typos in Rust code comments 2019-12-20 10:16:36 -08:00
Sean McArthur
6d2bcef272 perf(upgrade): forward vectored writes on the Upgraded type 2019-12-19 15:33:12 -08:00
Sean McArthur
61b62eeac8 v0.13.1 2019-12-16 11:44:04 -08:00
Sean McArthur
4b6099c7aa feat(body): implement HttpBody for Request and Response
When the body type of a `Request` or `Response` implements `HttpBody`,
the `Request` or `Response` itself now implements `HttpBody`.

This allows writing things like `hyper::body::aggregate(req)` instead of
`hyper::body::aggregate(req.into_body())`.

Closes #2067
2019-12-13 10:48:30 -08:00
Euclidr
bfda390617 docs(server): http_proxy example 2019-12-12 16:59:38 -08:00
Sean McArthur
703ac340cb docs(body): fill in documentation of the to_bytes function 2019-12-12 15:26:54 -08:00
Sean McArthur
cb71d2cdbd fix(http1): fix response with non-chunked transfer-encoding to be close-delimited
Closes #2058
2019-12-12 14:26:56 -08:00
Sean McArthur
e12329054a refactor(http1): fix for unused must_use on read_buf.split_to 2019-12-12 14:17:33 -08:00
Sean McArthur
d1f6136ce2 test(http1): only enable WriteBuf non-empty test with debug-assertions
Closes #2062
2019-12-12 12:12:32 -08:00
Sean McArthur
2553ea1a7a feat(client): expose hyper::client::connect::Connect trait alias
This is *just* a "trait alias". It is automatically implemented for all
`Service<Uri>`s that have the required bounds. It's purpose being public
is to ease setting trait bounds outside of hyper. Therefore, it doesn't
have any exposed associated types, to prevent otherwise relying on any
super-traits that hyper requires.
2019-12-12 11:58:05 -08:00
Sean McArthur
a07142da2d refactor(client): remove Unpin requirement from request body 2019-12-11 14:18:56 -08:00
Sean McArthur
52cc3f7367 refactor(client): remove Unpin requirement on Body::Data 2019-12-11 14:18:56 -08:00
Sean McArthur
57ef271500 docs(lib): fix broken intra docs links 2019-12-11 13:23:36 -08:00
Sean McArthur
bdca4992fc chore(CI): add cargo doc step to CI 2019-12-11 13:23:36 -08:00
Sean McArthur
e0ea2aeeca docs(server): fix ICE documenting pub(super) through pin_project 2019-12-11 13:23:36 -08:00
Sean McArthur
070c84ec43 v0.13.0 2019-12-10 09:45:42 -08:00