Commit Graph

19 Commits

Author SHA1 Message Date
Rick Richardson
7615867a5e fixing the akamai example to work with tokio-0.2 (#408)
* fixing the akamai example to work with tokio-0.2

* manually spawn the h2 task to make it go

* fix tokio-rustls dependency version
2019-09-23 12:57:06 -07:00
Gurwinder Singh
85b1f669c0 chore: async_await is stable on nightly 2019-08-21 11:10:03 -07:00
Gurwinder Singh
0a4bd393ec Update examples to std-future 2019-08-16 18:47:47 -07:00
Jakub Beránek
db6b841e67 Update crate to Rust 2018 (#383) 2019-07-23 10:18:43 -07:00
Eliza Weisman
00ca534c4a Update examples to use new Tokio (#316)
The old `tokio-core` crate is deprecated in favour of the `tokio` crate,
which also provides the new multithreaded Tokio runtime. Although `h2`
is generic over the runtime, the examples do depend on `tokio`. 

This branch update the example code to use the new `tokio` library
rather than `tokio-core`. It also updates the examples in `RustDoc`.

For the most part, this was pretty trivial --- simply replacing
`handle.spawn(...)` with `tokio::spawn(...)` and `core.run(...)` with
`tokio::run(...)`. There were a couple of cases where error and item
types from spawned futures had to be mapped to `(), ()`. Alternatively,
this could have been avoided by using the single-threaded runtime and
calling `block_on` instead to await the value of those futures, but I
thought it was better to reduce the amount of tokio-specific code in the
examples.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-09-25 14:33:49 -07:00
Brian Smith
b6724f7d7a Upgrade to env_logger 0.5 & log 0.4; reduce related dependencies (#226)
Upgrade to env_logger 0.5 and log 0.4 so that projects that use those
versions don't have to build both those versions and the older ones
that h2 is currently using.

Don't enable the regex support in env_logger. Applications that want
the regex support can enable it themselves; this will happen
automatically when they add their env_logger dependency.

Disable the env_logger dependency in quickcheck.

The result of this is that there are fewer dependencies. For example,
regex and its dependencies are no longer required at all, as can be
seen by observing the changes to the Cargo.lock. That said,
env_logger 0.5 does add more dependencies itself; however it seems
applications are going to use env_logger 0.5 anyway so this is still
a net gain.

Submitted on behalf of Buoyant, Inc.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-02-23 20:25:42 -08:00
Carl Lerche
f27056467c Track rustls / ring 2018-01-11 22:35:47 -08:00
Carl Lerche
d0b5b6246a Misc renames (#202)
This patch renames a number of types and functions making
the API more consistent.

* `Server` -> `Connection`
* `Client` -> `SendRequest`
* `Respond` -> `SendResponse`.

It also moves the handshake fns off of `Connection` and make
them free fns in the module. And `Connection::builder` is removed
in favor of `Builder::new`.
2018-01-02 17:02:17 -08:00
Carl Lerche
faf59f7e24 Split response future from client::Stream (#153) 2017-10-16 20:17:07 -07:00
Sean McArthur
f8efb053b9 split Client into (Client, Connection) (#107)
The Connection type is a `Future` that drives all of the IO of the
client connection.

The Client type is separate, and is used to send requests into the
connection.
2017-09-28 16:55:12 -07:00
Carl Lerche
e049dcb62b Rename Client::request -> send_request (#98)
All other fns have a send prefix.
2017-09-18 21:22:15 -07:00
Sean McArthur
f7d14861e5 rustfmt: add trailing commas in match arms, set fn call to block stle (#85) 2017-09-12 19:29:06 -07:00
Oliver Gould
897bf84163 Use rustfmt to enforce consistent formatting
This change adds a .rustfmt.toml that includes ALL supported settings,
12 of which we have overridden to attempt to cater to our own
proclivities.

rustfmt is checked in the rust-nightly CI job.
2017-09-12 22:29:35 +00:00
Carl Lerche
c2e6eb35d8 Track HTTP crate 2017-09-05 10:21:31 -07:00
Carl Lerche
88d1de2da0 Expose Codec via an unstable flag (#49)
Exposes `Codec` using an unstable flag. This is useful for testing.
2017-09-03 16:17:05 -07:00
Brian Smith
63ba0073a4 Update TLS-related dependencies. (#41)
Use a temporary private fork of tokio-rustls that uses Rustls 0.12
until tokio-rustls 0.4 is released.

This upgrades, among other things, *ring* to 0.12, which will ensure
that it still builds in the Rust 1.20 release coming this week even if
backward-compatibility-breaking changes to rustc aren't fixed before
the release.
2017-08-29 13:23:38 -04:00
Brian Smith
2992594552 Switch Akamai example from rust-openssl to Rustls. (#24)
With this change, h2 can build and run without any manual configuration steps for -msvc targets. Previously manual installation of OpenSSL libraries was required.
2017-08-16 21:43:35 -07:00
Carl Lerche
fa66323cec Akamai request kind of works 2017-08-08 09:47:29 -07:00
Carl Lerche
f6b6d0c7e8 Start state transition verification + refactors 2017-07-07 10:33:04 -07:00