Commit Graph

258 Commits

Author SHA1 Message Date
Sean McArthur
ec7b93c982 v0.12.20 2019-01-07 15:04:42 -08:00
Sean McArthur
e5135dd6f6 fix(dependencies): disable unneeded optional tokio features
Closes #1739
2019-01-07 15:03:20 -08:00
Sean McArthur
5abbe59696 v0.12.19 2018-12-18 12:47:11 -08:00
Sean McArthur
720c068e56 v0.12.18 2018-12-11 16:14:13 -08:00
Sean McArthur
fdd0413418 v0.12.17 2018-12-05 17:01:07 -08:00
Sean McArthur
65788fe7fe test(client): disable happy eyeballs tests except in CI 2018-12-05 10:57:37 -08:00
Sean McArthur
c35bdca8fa chore(dependencies): update http to 0.1.14 for Uri::port_part 2018-11-27 11:55:02 -08:00
Sean McArthur
7fb6e3a3ff v0.12.16 2018-11-21 16:43:12 -08:00
Sean McArthur
92a8aba610 v0.12.15 2018-11-20 12:55:08 -08:00
Sean McArthur
1158bd20b3 v0.12.14 2018-11-07 11:01:47 -08:00
Sean McArthur
3af6aa80af v0.12.13 2018-10-26 13:04:03 -07:00
Sean McArthur
dcf0347151 test(benches): add http1 pipeline bench target 2018-10-23 16:01:16 -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
ced949cb6b feat(server): allow !Send Servers
Until this commit, servers have required that `Service` and their
`Future` to be `Send`, since the server needs to spawn some internal
tasks to an executor, and by default, that is `tokio::spawn`, which
could be spawning to a threadpool. This was true even if the user were
certain there was no threadpool involved, and was instead using a
different single-threaded runtime, like
`tokio::runtime::current_thread`.

This changes makes all the server pieces generic over an `E`, which is
essentially `Executor<PrivateTypes<Server::Future>>`. There's a new set
of internal traits, `H2Exec` and `NewSvcExec`, which allow for the type
signature to only show the generics that the user is providing. The
traits cannot be implemented explicitly, but there are blanket
implementations for `E: Executor<SpecificType>`. If the user provides
their own executor, it simply needs to have a generic `impl<F>
Executor<F> for MyExec`. That impl can have bounds deciding whether to
require `F: Send`. If the executor does require `Send`, and the
`Service` futures are `!Send`, there will be compiler errors.

To prevent a breaking change, all the types that gained the `E` generic
have a default type set, which is the original `tokio::spawn` executor.
2018-10-16 13:21:45 -07:00
Sean McArthur
00c96de0b9 v0.12.12 2018-10-16 10:22:02 -07:00
Ahmed Charles
9fa721df9e docs(examples): add proxy example 2018-10-02 10:07:31 -07:00
Sean McArthur
5c3415d704 v0.12.11 2018-09-28 13:04:52 -07:00
Sean McArthur
09156a70a6 refactor(lib): remove build script features since minimum version is higher 2018-09-28 12:02:21 -07:00
Sean McArthur
8f91747466 v0.12.10 2018-09-14 17:43:30 -07:00
Sean McArthur
2f19578162 test(http1): add test for when headers contain HTABs 2018-09-14 17:42:10 -07:00
Sean McArthur
57556e6329 v0.12.9 2018-08-28 17:31:21 -07:00
Sean McArthur
bdbaa85f41 v0.12.8 2018-08-10 14:42:27 -07:00
Niv Kaminer
9f8add6056 chore(client): place the use of new rust features behind cfg 2018-08-07 19:36:00 -07:00
Sean McArthur
069a32b1ac v0.12.7 2018-07-23 09:51:38 -07:00
Sean McArthur
8a04a97464 v0.12.6 2018-07-11 17:20:20 -07:00
Igor Gnatenko
7b54e9ccae chore(dependencies): update want to 0.0.6 2018-07-11 14:20:39 -07:00
Sean McArthur
ae34a86cc3 docs(examples): add a stateful server example with a request counter 2018-07-06 15:24:01 -07:00
ozgurakkurt
e06dc52ef6 docs(client): Add client_json example
Closes #1581
2018-07-03 14:41:50 -07:00
Sean McArthur
5a3efda0e7 v0.12.5 2018-06-28 20:53:50 -07:00
Sean McArthur
6aff27523a chore(h2): fix minimum h2 version 2018-06-28 18:00:12 -07:00
Sean McArthur
8cf6f145ac v0.12.4 2018-06-28 16:21:27 -07:00
Sean McArthur
d7436cfbe0 v0.12.3 2018-06-25 12:46:41 -07:00
Sean McArthur
2a3844acc3 feat(client): enable CONNECT requests through the Client
While the upgrades feature enabled HTTP upgrades in both and the server and client, and the goal was for `CONNECT` requests to work as well, only the server could use them for `CONNECT`. The `Client` had some specific code rejecting `CONNECT` requests, and this removes it and prepares the `Client` to handle them correctly.
2018-06-22 21:00:28 -07:00
Sean McArthur
ac1af8d15b perf(headers): switch from fmt to itoa when writing content-length header 2018-06-20 17:19:37 -07:00
Sean McArthur
9b4083de6b v0.12.2 2018-06-19 11:30:05 -07:00
Sean McArthur
29a8074689 chore(dependencies): update want to 0.0.5 2018-06-14 13:41:03 -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
Sean McArthur
e5118d7eea v0.12.1 2018-06-04 17:10:29 -07:00
Aaron Riekenberg
7eca445ff9 docs(examples): Update send_file example to use tokio-fs 2018-06-04 09:59:42 -07:00
Sean McArthur
785914e77e chore(body): fix unused import in chunk benchmarks 2018-06-04 09:52:54 -07:00
Sean McArthur
497654958e v0.12.0 2018-06-01 15:40:55 -07:00
Sean McArthur
58004b847c docs(lib): update description of hyper 2018-06-01 15:22:53 -07:00
Sean McArthur
2051d5c04a chore(cargo): only use 1 codegen unit when benchmarking 2018-05-30 13:22:37 -07:00
estk
bc6af88a32 feat(server): support HTTP1 and HTTP2 automatically
If an HTTP/1 connection has a parse error, but it starts with the HTTP2 preface, converts the connection automatically into an HTTP2 server connection.

Closes #1486
2018-05-10 14:23:42 -07:00
Sean McArthur
18f4dd2406 chore(ci): remove flaky tests from failing CI 2018-05-09 16:02:49 -07:00
Sean McArthur
7de3bc97c6 chore(examples): update server example name to echo 2018-05-03 12:08:49 -07:00
Sean McArthur
7a7453ba52 refactor(lib): change from futures-timer to tokio-timer 2018-04-30 19:11:05 -07:00
Sean McArthur
604ebfbf6f perf(client): reduce an allocation per http2 connection 2018-04-25 16:40:34 -07:00
Sean McArthur
d127201ef2 feat(rt): make tokio runtime optional
A Cargo feature `runtime` is added, which is enabled by default, that
includes the following:

- The `client::HttpConnector`, which uses `tokio::net::TcpStream`.
- The `server::AddrStream`, which uses `tokio::net::TcpListener`.
- The `hyper::rt` module, which includes useful utilities to work with
  the runtime without needing to import `futures` or `tokio` explicity.

Disabling the feature removes many of these niceties, but allows people
to use hyper in environments that have an alternative runtime, without
needing to download an unused one.
2018-04-23 16:56:26 -07:00