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
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
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
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
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
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
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
Taiki Endo
053d6497bd
chore(dependencies): update tokio, h2, and tower-make
2019-09-23 12:45:37 -07:00
Sean McArthur
d46cde1216
test(client): remove warning about disabled tests
2019-09-11 14:55:14 -07:00
Weihang Lo
144893b409
Upgrade some lib tests to async/.await version ( #1882 )
...
* test(http): use async/.await
Signed-off-by: Weihang Lo <me@weihanglo.tw >
* test(pool): use async/.await
* test(pool): pass &mut Future into PollOnce
* test(client): tests/benches using async/.await
* test(client): change due to PR #1917
* test(client): change Delay to delay fucntion
Ref: https://github.com/tokio-rs/tokio/pull/1440
* test(client): remove warning triggers
2019-09-06 09:54:11 -07:00
Lucio Franco
eee2a72879
feat(client): provide tower::Service support for clients ( #1915 )
2019-08-30 12:54:22 -07:00
Alex Gaynor
eef407d60e
docs(client): Remove comment that had grown out of date ( #1918 )
2019-08-30 11:14:56 -07:00
Sean McArthur
049b5132db
feat(client): change GaiResolver to use a global blocking threadpool
...
BREAKING CHANGE: Calls to `GaiResolver::new` and `HttpConnector::new` no
longer should pass an integer argument for the number of threads.
2019-08-29 14:16:43 -07:00
Sean McArthur
5b1feb8a3c
refactor(lib): update to tokio alpha.4
2019-08-29 13:12:44 -07:00
Daniel Johnson
536779e16c
refactor(dns): migrate deprecated trim_{left,right} -> trim_{start,end}
2019-08-29 11:12:56 -07:00
Sean McArthur
49b12c415d
refactor(lib): fix remaining lint warnings (besides tests)
2019-08-22 13:57:50 -07:00
Sean McArthur
7b1d6d71b7
refactor(lib): fix many lint warnings
2019-08-21 11:58:02 -07:00
lzutao
fc7f81b67c
style(lib): use rust 2018 edition idioms ( #1910 )
2019-08-21 11:22:07 -07:00
lzutao
ae75b3a732
chore(lib): remove async_await feature gate ( #1909 )
...
`async_await` is stabilized in rust-lang/rust#63209 .
2019-08-21 11:09:14 -07:00
Sean McArthur
7508bd87b0
refactor(client): restore handshake to by-ref
2019-08-19 16:10:57 -07:00
Sean McArthur
41f4173615
refactor(http2): re-enable http2 client and server support
2019-08-19 15:55:49 -07:00
Douman
4920f5e264
chore(dependencies): Upgrade tokio
2019-08-19 09:00:21 -07:00
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