Commit Graph

383 Commits

Author SHA1 Message Date
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
Sean McArthur
2dc6202fe7 feat(service): introduce hyper-specific Service
This introduces the `hyper::service` module, which replaces
`tokio-service`.

Since the trait is specific to hyper, its associated
types have been adjusted. It didn't make sense to need to define
`Service<Request=http::Request>`, since we already know the context is
HTTP. Instead, the request and response bodies are associated types now,
and slightly stricter bounds have been placed on `Error`.

The helpers `service_fn` and `service_fn_ok` should be sufficient for
now to ease creating `Service`s.

The `NewService` trait now allows service creation to also be
asynchronous.

These traits are similar to `tower` in nature, and possibly will be
replaced completely by it in the future. For now, hyper defining its own
allows the traits to have better context, and prevents breaking changes
in `tower` from affecting hyper.

Closes #1461

BREAKING CHANGE: The `Service` trait has changed: it has some changed
  associated types, and `call` is now bound to `&mut self`.

  The `NewService` trait has changed: it has some changed associated
  types, and `new_service` now returns a `Future`.

  `Client` no longer implements `Service` for now.

  `hyper::server::conn::Serve` now returns `Connecting` instead of
  `Connection`s, since `new_service` can now return a `Future`. The
  `Connecting` is a future wrapping the new service future, returning
  a `Connection` afterwards. In many cases, `Future::flatten` can be
  used.
2018-04-17 17:09:15 -07:00
Sean McArthur
c119097fd0 feat(http2): add HTTP/2 support for Client and Server 2018-04-13 14:23:47 -07:00
Sean McArthur
c210524e94 chore(tests): fix tokio runtime deprecations 2018-04-10 12:56:55 -07:00
Sean McArthur
625e4daaa1 Revert "refactor(lib): convert to futures 0.2.0-beta (#1470)"
This reverts commit a12f7beed9.

Much sadness 😢.
2018-04-10 12:56:55 -07:00
Sean McArthur
21ba669b34 chore(dependencies): pin to a git commit of futures 0.2.0-beta 2018-04-06 19:09:58 -07:00
Sean McArthur
7b99ccb0f2 chore(dependencies): pin to futures =0.2.0-beta 2018-04-06 18:47:37 -07:00
Sam Rijs
06405c2c49 chore(dependencies): move to futures master (#1478) 2018-04-03 11:27:22 -07:00
Sam Rijs
a12f7beed9 refactor(lib): convert to futures 0.2.0-beta (#1470) 2018-03-29 13:32:44 -07:00
Sean McArthur
5db85316a1 refactor(client): replace signal mod with want crate 2018-03-19 11:43:47 -07:00
Sean McArthur
06f0126fad refactor(lib): clean up unused dependencies 2018-03-19 11:43:47 -07:00
Sam Reis
27b8db3af8 feat(lib): convert to use tokio 0.1
BREAKING CHANGE: All uses of `Handle` now need to be new-tokio `Handle`.

Co-authored-by: Sean McArthur <sean@seanmonstar.com>
2018-03-19 11:43:47 -07:00
Sean McArthur
3cd48b45fb feat(lib): replace types with those from http crate
BREAKING CHANGE: `Method`, `Request`, `Response`, `StatusCode`,
  `Version`, and `Uri` have been replaced with types from the `http`
  crate. The `hyper::header` module is gone for now.

  Removed `Client::get`, since it needed to construct a `Request<B>`
  with an empty body. Just use `Client::request` instead.

  Removed `compat` cargo feature, and `compat` related API.
2018-03-19 11:43:47 -07:00
Sean McArthur
a37e6b59e6 fix(lib): remove deprecated tokio-proto APIs
BREAKING CHANGE: Many of these APIs have been deprecated for a while,
  check the documentation for the recommended way to use hyper now.
2018-03-19 11:37:32 -07:00
Sean McArthur
dbfc45bf5c chore(lib): start 0.12.x branch 2018-03-19 11:37:32 -07:00
Sean McArthur
0786ea1f87 v0.11.22 2018-03-07 12:56:57 -08:00
Klaus Purer
49fcb0663c fix(dependencies): require tokio-core 0.1.11 2018-03-05 10:32:31 -08:00
Sean McArthur
f7102ae6c4 v0.11.21 2018-02-28 15:17:02 -08:00
Sean McArthur
ad7763072c v0.11.20 2018-02-26 15:07:38 -08:00
Sean McArthur
36eabbb18f v0.11.19 2018-02-21 13:15:57 -08:00
Sean McArthur
8e57338ef0 v0.11.18 2018-02-07 13:59:47 -08:00
Sean McArthur
1eb18a9e44 v0.11.17 2018-02-05 16:37:43 -08:00
Sean McArthur
bf5eb5e0a0 v0.11.16 2018-01-30 13:28:13 -08:00
Sean McArthur
68377ede70 perf(http): utilize writev when possible
By using `AsyncWrite::write_buf`, we can avoid some copies in some
cases. This especially helps throughput for chunked encoding.
2018-01-25 14:02:11 -08:00
Sean McArthur
be9d5e8d5c v0.11.15 2018-01-22 12:17:33 -08:00
Sean McArthur
7d493aafce chore(depenencies): update pretty-env-logger to 0.2 2018-01-19 17:37:34 -08:00