Commit Graph

2166 Commits

Author SHA1 Message Date
Sean McArthur
b0060f277e chore(CI): enable GitHub Actions 2019-12-05 13:12:35 -08:00
David Barsky
edbd10ac96 feat(client): impl tower_service::Service for Client 2019-12-05 11:37:43 -08:00
Sean McArthur
0b03b73053 feat(lib): rename unstable-stream feature to stream and enable by default
Closes #2034
2019-12-04 17:09:10 -08:00
Sean McArthur
aa66de4f27 refactor(h1): un-split record_header_indicies for ARM 2019-12-04 16:58:35 -08:00
Sean McArthur
a738d03fd3 chore(dependencies): update to http-body 0.3 2019-12-04 16:48:06 -08:00
Sean McArthur
4d7a2266b8 feat(client): change connectors to return an impl Connection
Instead of returning a tuple `(impl AsyncRead + AsyncWrite, Connected)`,
this adds a new trait, `hyper::client::connect::Connection`, which
allows querying the connection type for a `Connected`.

BREAKING CHANGE: Connectors no longer return a tuple of
  `(T, Connected)`, but a single `T: Connection`.
2019-12-04 16:15:28 -08:00
Sean McArthur
319e8aee15 feat(client): remove Destination for http::Uri in connectors
BREAKING CHANGE: All usage of `hyper::client::connect::Destination`
  should be replaced with `http::Uri`.
2019-12-04 16:15:28 -08:00
Sean McArthur
9645a125e6 refactor(client): return HttpConnecting newtype 2019-12-04 14:06:16 -08:00
Markus Westerlind
30ac01c180 refactor(client): use async/await in HttpConnector (#2019)
Closes #1984
2019-12-04 13:39:56 -08:00
David Barsky
19a7aab51f chore(dependencies): update tower-service to 0.3 2019-12-04 12:13:14 -08:00
Sean McArthur
c63728eb38 feat(body): replace the Payload trait with HttpBody
The `hyper::body::HttpBody` trait is a re-export from the `http-body`
crate. This allows libraries to accept "HTTP bodies" without needing to
depend on hyper.

BREAKING CHANGE: All usage of `hyper::body::Payload` should be replaced
  with `hyper::body::HttpBody`.
2019-12-04 11:57:13 -08:00
Adam C. Foltzer
3cc93e796a feat(server): give Server::local_addr a more general type
Allows `local_addr` to work for any executor type, rather than just the default `Exec`. The
underlying `SpawnAll::local_addr()` is already similarly general, so no other changes are needed
other than adding the extra type parameter to the `impl`.
2019-12-04 11:49:28 -08:00
Sean McArthur
6ae5889f83 feat(rt): introduce rt::Executor trait
The `hyper::rt::Executor` trait allows defining custom executors to be
used with hyper's `Client` and `Server`.

Closes #1944

BREAKING CHANGE: Any type passed to the `executor` builder methods must
  now implement `hyper::rt::Executor`.

  `hyper::rt::spawn` usage should be replaced with `tokio::task::spawn`.

  `hyper::rt::run` usage should be replaced with `#[tokio::main]` or
  managing a `tokio::runtime::Runtime` manually.
2019-12-04 11:38:23 -08:00
Sean McArthur
cb3f39c2dc feat(lib): update Tokio, bytes, http, h2, and http-body 2019-12-04 10:56:34 -08:00
James Le Cuirot
131962c86a feat(client): filter remote IP addresses by family of given local IP address
It is not possible to connect to an IPv4 address from an IPv6 address or
vice-versa so don't waste time trying. If no remote addresses match then a
"missing connect error" will now occur.
2019-11-19 10:36:07 -08:00
Daniel Johnson
71d088d3d0 chore(dependencies): update futures to 0.3.1 2019-11-14 10:04:16 -08:00
Sean McArthur
9d9233ce7c feat(client): change Resolve to be Service<Name>
Closes #1903

BREAKING CHANGE: The `Resolve` trait is gone. All custom resolves should
  implement `tower::Service` instead.

  The error type of `HttpConnector` has been changed away from
  `std::io::Error`.
2019-11-12 13:08:39 -08:00
Sean McArthur
039281b89c fix(client): fix polling dispatch channel after it has closed 2019-10-30 14:34:19 -07:00
Dirkjan Ochtman
de5dcd7865 refactor(lib): use dedicated enums for connection protocol versions
This should make it easier to add H3 functionality.
2019-10-30 14:03:29 -07:00
Sean McArthur
e6027bc02d fix(client): fix panic from unreachable code 2019-10-30 13:45:23 -07:00
Sean McArthur
b5e70a0dd1 refactor(server): remove more 'static bounds on Server 2019-10-24 13:37:11 -07:00
Sean McArthur
8b878a805a perf(client): change HttpConnecting to hold Arc<Config> instead of inlined fields 2019-10-23 16:21:51 -07:00
Sean McArthur
f71304b449 refactor(client): use pin_project for Resolve futures 2019-10-23 14:37:03 -07:00
Sean McArthur
10cda4beff refactor(http2): replace server Unpin impl with pin_project 2019-10-22 18:33:05 -07:00
Sean McArthur
3ee47199d9 refactor(client): de-duplicate HttpConnector::call code 2019-10-22 17:50:13 -07:00
Sean McArthur
d67e49f149 feat(client): change Connect trait into an alias for Service
The `Connect` trait is now essentially an alias for
`Service<Destination>`, with a blanket implementation as such, and is
sealed.

Closes #1902

BREAKING CHANGE: Any manual implementations of `Connect` must instead
  implement `tower::Service<Destination>`.
2019-10-22 14:40:23 -07:00
Sean McArthur
4f2743991c feat(service): rename Service to HttpService, re-export tower::Service`
The only important trait for a user is the `tower::Service` trait, which
is now available also at `hyper::service::Service`. The other "trait
aliases" are no longer publicly exported, as people thought they had to
implement them.

Also removes dependency on `tower-make`, which is trivial but otherwise
shouldn't affect anyone.

Closes #1959
2019-10-21 11:01:28 -07:00
Sean McArthur
ca5836f1ec fix(server): ignore expect-continue with no body in debug mode
Closes #1843
2019-10-18 15:44:01 -07:00
Sean McArthur
a1fe383c9d refactor(http1): notice eof in the try_keep_alive method 2019-10-18 15:16:07 -07:00
Sean McArthur
2d6bbd2cd8 chore(ci): re-enable CI running on beta 2019-10-18 15:16:07 -07:00
Sean McArthur
7e31fd88a8 feat(server): change http1_half_close option default to disabled
Detecting a read hangup is a useful way to determine that a connection
has closed. It's also possible that a client shuts down its read half
without closing the connection, but this is rarer. Thus, by default,
hyper will now assume a read EOF means the connection has closed.

BREAKING CHANGE: The server's behavior will now by default close
  connections when receiving a read EOF. To allow for clients to close
  the read half, call `http1_half_close(true)` when configuring a
  server.
2019-10-18 13:34:23 -07:00
Sean McArthur
8e7ebd80cd refactor(error): update Debug for Error to output 'hyper::Error' 2019-10-17 12:18:53 -07:00
Christopher Vittal
1235f1de9a docs(service): remove reference to service_fn_ok (#1978)
This function has been otherwise removed and the link was broken.
2019-10-17 10:22:30 -07:00
Sean McArthur
5cb95bdda4 test(benches): add http2 chunks benchmark with default window size 2019-10-15 18:29:33 -07:00
Sean McArthur
51cdbea826 test(benches): add end-to-end chunked benchmarks 2019-10-15 18:05:57 -07:00
Steven Fackler
4179297ac9 feat(client): Add connect timeout to HttpConnector (#1972)
This takes the same strategy as golang, where the timeout value is
divided equally between the candidate socket addresses.

If happy eyeballs is enabled, the division takes place "below" the
IPv4/IPv6 partitioning.
2019-10-14 11:48:17 -07:00
Ben Boeckel
536b1e184e fix(dependencies): require correct bytes minimum version (#1975)
`Bytes::advance` was introduced in this version.
2019-10-14 11:28:41 -07:00
Steven Fackler
4d14712643 fix(server): Remove unneeded 'static bound of Service on Connection (#1971) 2019-10-11 16:22:36 -07:00
Sean McArthur
22695968d2 perf(http2): improve default HTTP2 flow control settings
Set default HTTP2 window sizes much larger values than the spec default.

ref #1960
2019-10-08 15:39:35 -07:00
Hamza Muric
b4dbad6dbf docs(changelog): fix mention of stream feature to unstable-stream (#1968) 2019-10-04 13:14:26 -07:00
Sean McArthur
0ef12a11a8 v0.13.0-alpha.4 2019-10-01 11:43:38 -07:00
Sean McArthur
64fe70b2f9 chore(dependencies): update http-body to alpha.3 2019-10-01 11:39:57 -07:00
Sean McArthur
353be888fa v0.13.0-alpha.3 2019-10-01 10:28:13 -07:00
Sean McArthur
7601fc6b8d chore(dependencies): update http-body to alpha.2 2019-10-01 10:25:08 -07:00
Sean McArthur
5b348b821c feat(lib): add optional tcp feature, split from runtime
The `HttpConnector` and `AddrListener` types which make use of
`tokio::tcp` have been made their own optional feature. This allows
using them without requiring the *full* tokio runtime.
2019-10-01 10:15:46 -07:00
Jon Gjengset
02b584435f chore(dependencies): Use new alpha release of h2 2019-10-01 09:39:29 -07:00
Taiki Endo
d2b0fed028 chore(dependencies): update tokio, h2, and tower 2019-10-01 06:40:41 -07:00
Taiki Endo
bcb66736fb chore(dependencies): update pin-project to 0.4 2019-10-01 06:40:41 -07:00
Sean McArthur
d40978ce08 v0.13.0-alpha.2 2019-09-24 12:21:24 -07:00
Taiki Endo
053d6497bd chore(dependencies): update tokio, h2, and tower-make 2019-09-23 12:45:37 -07:00