Commit Graph

369 Commits

Author SHA1 Message Date
Kyle Huey
a503f8b336 fix(client): impl<T: Connect> Connect for Box<T> (#1889) 2019-08-14 14:10:40 -07:00
Sean McArthur
1d00bb29d4 chore(client): re-enable client's custom executor config 2019-07-19 14:18:10 -07:00
Weihang Lo
c71abe5c20 docs(client): doc tests to async/await 2019-07-15 11:21:16 -07:00
Weihang Lo
e90f0037d3 docs(client): HttpInfo doc test to async/await 2019-07-15 11:21:16 -07:00
Weihang Lo
e0c1090ca7 docs(client): send_request doc test to async/await 2019-07-15 11:21:16 -07:00
Sean McArthur
5da17df97f chore(lib): individually disable tests and examples that aren't updated 2019-07-12 13:44:03 -07:00
Sean McArthur
3524db9473 refactor(client): use a tokio-threadpool for the GaiResolver 2019-07-10 16:11:05 -07:00
Sean McArthur
8d4ae27b42 refactor(lib): remove build script detecting rust >= 1.34 2019-07-10 10:23:48 -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
Dietmar Maurer
cf24765a22 style(client): HttpConnector: use consistent naming - s/buf/buffer/ (#1840)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2019-07-02 09:45:59 -07:00
Dietmar Maurer
386109c421 feat(client): HttpConnector: allow to set socket buffer sizes
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2019-07-01 11:09:04 -07:00
Sean McArthur
50198851a2 fix(http2): correctly propagate HTTP2 request cancellation 2019-06-03 14:39:35 -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
Andy Moran
d1183a8027 feat(client): Implement TryFrom for Destination (#1810)
Add TryFrom<Uri> impl for Destination, for compiler version >= 1.34.

Closes #1808
2019-05-08 18:39:47 -07:00
Sean McArthur
271bba1667 refactor(error): improve organization of Error kinds
- Placed all cases of "unexpected bytes" errors into the
  `UnexpectedMessage` variant.
- Placed all cases of "unexpected EOF" errors into the
  `IncompleteMessage` variant. Description is now generic about
  "connection closed before message completed", instead of mentioning
  "request" or "response.
- Added `Error::is_incomplete_message()` accessor to help checking for
  unexpected closures.
- Renamed some variants to be clearer when viewing the `Debug` format.
- Collected all "user" errors into an internal `User` enum, to prevent
  forgetting to update the `is_user()` method.
2019-04-26 10:44:40 -07:00
quininer
4133181bb2 fix(client): fix a rare connection pool race condition
It's possible for `PoolInner::put` to happen between `Pool::take` and `Pool::waiter`. This merges `take` and `waiter` into using the same lock.
2019-04-23 13:55:34 -07:00
Vitaly Shukela
edf551b55f feat(client,server) Add Connection::without_shutdown()
* Add `server::conn::Connection::without_shutdown`

  Returns wrapper Future instance which allows
  to use `poll_without_shutdown` method
  more ergonomically.

* Add `client::conn::Connection::without_shutdown`

  Returns wrapper Future instance which allows
  to use `poll_without_shutdown` method
  more ergonomically.

* Improve `poll_without_shutdown` docs

Closes #1786
2019-03-26 15:16:06 -07:00
Kevin Leimkuhler
7dcd4618c0 feat(http2): Add window size config options for Client and Server
Add `fn http2_initial_stream_window_size` and `fn
http2_initial_connection_window_size` for client and server.

Closes #1771
2019-03-01 14:44:38 -08:00
Sean McArthur
3a6080b14a fix(client): coerce HTTP_2 requests to HTTP_11
Closes #1770
2019-02-27 17:00:25 -08:00
Sean McArthur
ce2b540f9d chore(client): adjust dispatch giver throughput benchmark generics 2019-02-25 17:35:46 -08:00
Sean McArthur
1e6603353e perf(http2): don't register callback with main h2 client task 2019-02-25 17:27:51 -08:00
Sean McArthur
1161479945 test(client): add client benchmarks with mocked IO 2019-02-25 14:05:00 -08:00
Sean McArthur
c0e08a41cc refactor(lib): improve client and h1 logs 2019-02-15 15:58:35 -08:00
Sean McArthur
d16b2c3081 fix(client): fix panic when CONNECT request doesn't have a port 2019-02-11 12:05:52 -08:00
Sean McArthur
18f022c70b docs(lib): fix several broken links throughout docs
Closes #1749
Closes #1750
2019-01-24 11:20:22 -08:00
Alexander Mielczarek
078ed82dd5 feat(client): add conn::Builder::max_buf_size()
This allows users to configure a limit to client connections' read and
write buffers.

Closes #1748
2019-01-24 10:59:24 -08:00
Sean McArthur
c328c62ec2 fix(client): parse IPv6 hosts correctly in HttpConnector 2019-01-23 11:24:26 -08:00
Sean McArthur
83dad03a81 test(client): update tests for http::Uri::host fix 2019-01-22 15:02:23 -08:00
Sean McArthur
c69d1094b3 refactor(lib): replace 'try' macro with '?' 2019-01-18 14:29:12 -08:00
Lucio Franco
c809542c83 feat(client): add Destination::try_from_uri constructor
This change adds a try_from_uri function for creating Destinations
outside of the hyper crate. The Destination can only be built if the
uri contains a valid authority and scheme as these are required to
build a Destination.
2019-01-15 09:45:30 -08:00
Linus Färnstrand
be5ec45571 feat(client): Add useful trait impls to Name 2019-01-11 10:01:28 -08:00
Sean McArthur
8842da9184 docs(client): touch ups for Client, Builder, and connect types 2019-01-10 12:18:16 -08:00
Linus Färnstrand
607c4da0b9 feat(client): add FromStr impl for Name 2019-01-10 09:39:26 -08:00
Sean McArthur
1d253b4d47 fix(rt): prevent fallback reactor thread from being created accidentally
Switches from `Handle::current()` to `Handle::default()`.
2018-12-18 12:44:08 -08:00
Sean McArthur
f8f926c14c doc(client): document that http2_only needs Prior Knowledge or ALPN
configured.

Closes #1698
2018-12-11 15:41:01 -08:00
Sean McArthur
3287a0cdab test(client): fix pool tests compilation errors 2018-12-06 16:55:24 -08:00
Sean McArthur
010a886516 refactor(client): remove dead exec function 2018-12-05 17:01:07 -08:00
Sean McArthur
4b3747110a refactor(client): clean up client config fields 2018-12-05 12:17:03 -08:00
Sean McArthur
65788fe7fe test(client): disable happy eyeballs tests except in CI 2018-12-05 10:57:37 -08:00
Jeff Labonte
69368f433f refactor(client): update from deprecated Uri::port to port_part (#1722) 2018-11-26 10:06:40 -08:00
Rick Richardson
2e7250b669 feat(client): add http1_read_buf_exact_size Builder option
This changes the read buffer strategy from being adaptive to always
using an exact size for the buffer.
2018-11-21 14:07:21 -08:00
Sean McArthur
95446cc338 feat(client): add client::conn::Builder::executor method 2018-11-16 16:32:09 -08:00
Sean McArthur
976a77a673 feat(client): add ALPN h2 support for client connectors
- Adds `Connected::negotiated_h2()` method to signal the connection must
  use HTTP2. `Connect` implementations should set this if using ALPN.

If a connection to a host is detected to have been upgraded via ALPN,
any other oustanding connect futures will be canceled, and the waiting
requests will make use of the single HTTP2 connection.

The `http2_only` builder configuration still works the same, not
requiring ALPN at all, and always using only a single connection.
2018-10-31 14:51:29 -07:00
Sean McArthur
deaa5d1aa9 chore(client): fix infinite recursion in TokioThreadpoolGaiResolver::new 2018-10-23 13:34:47 -07:00
Sean McArthur
34d780acd0 feat(dns): export client::connect::dns module, and
`TokioThreadpoolGaiResolver` type.
2018-10-23 12:49:56 -07:00
Steven Fackler
1e8d6439cf feat(dns): tokio_threadpool::blocking resolver
Unlike the default resolver, this avoids spawning extra dedicated
threads but only works on the multi-threaded Tokio runtime.

Closes #1676
2018-10-23 09:57:04 -07:00
Sean McArthur
6fe532da4c feat(client): allow Connected::extra to be chained to connectors can be composed 2018-10-18 15:51:19 -07:00
Sean McArthur
2d5af177c1 feat(client): add Resolve, used by HttpConnector
This introduces a `Resolve` trait to describe asynchronous DNS
resolution. The `HttpConnector` can be configured with a resolver,
allowing a user to still use all the functionality of the
`HttpConnector`, while customizing the DNS resolution.

To prevent a breaking change, the `HttpConnector` has its `Resolve`
generic set by default to `GaiResolver`. This is same as the existing
resolver, which uses `getaddrinfo` inside a thread pool.

Closes #1517
2018-10-18 12:10:15 -07:00
Sean McArthur
13d53e1d0c feat(client): adds HttpInfo to responses when HttpConnector is used
- Adds `client::connect::Connected::extra()`, which allows connectors to
  specify arbitrary custom information about a connected transport.

If a connector provides this extra value, it will be set in the
`Response` extensions.

Closes #1402
2018-10-16 14:40:50 -07:00