Commit Graph

66 Commits

Author SHA1 Message Date
Sean McArthur
dddef4ccbe v0.1.18 2019-04-09 12:29:22 -07:00
Sean McArthur
8e809c3e0c v0.1.17 2019-03-12 18:59:36 -07:00
Sean McArthur
74f040f5bf v0.1.16 (#344) 2019-01-24 10:37:47 -08:00
Carl Lerche
78c39d8e65 Bump version to v0.1.15 (#339) 2019-01-13 09:53:19 -08:00
Sean McArthur
61adb3570e v0.1.14 2018-12-05 10:05:46 -08:00
Igor Gnatenko
545ff1e7dd exclude more CI files and bump webpki to released version (#331) 2018-11-29 21:55:08 -08:00
Carl Lerche
80b4ec5073 Bump version to v0.1.13 (#324) 2018-10-16 14:41:23 -07:00
Michael Beaumont
6b23542a55 Add client support for server push (#314)
This patch exposes push promises to the client API.

Closes #252
2018-10-16 12:51:08 -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
Sean McArthur
3b57049792 v0.1.12 2018-08-08 16:05:27 -07:00
Eliza Weisman
78ab6167c4 v0.1.11 2018-07-31 11:44:01 -07:00
Jake Goulding
41aae14c64 Do not distribute the fixtures in published crates (#290) 2018-06-20 17:09:33 -07:00
Carl Lerche
e78e7f152d Bump version to v0.1.10 (#287) 2018-06-18 12:01:35 -07:00
Sean McArthur
1b9469ff75 v0.1.9 (#280) 2018-05-31 20:42:52 +02:00
Carl Lerche
82addd6369 Bump version to v0.1.8 (#278) 2018-05-23 11:34:23 -07:00
Carl Lerche
a955a15091 Bump version to v0.1.7 (#276) 2018-05-14 10:35:22 -07:00
Carl Lerche
173f9a67e7 Include fuzz testing setup (#274) 2018-05-10 14:48:02 -07:00
Carl Lerche
8a9dfd14dc Move tests and support utilities to sub crates. (#268)
These crates will not be published to crates.io, but moving them allows
`tower-h2` to also depend on the test utilities.
2018-05-03 13:08:39 -07:00
Sean McArthur
e8fcd34476 change from deprecated Buf::put_*<E> to put_*_be (#267) 2018-04-27 14:35:28 -07:00
Carl Lerche
279dd93354 Bump version to v0.1.6 (#264) 2018-04-24 20:47:17 -07:00
Oliver Gould
fabae35311 Bump version to v0.1.5 (#255) 2018-04-06 18:41:27 -07:00
Sean McArthur
60749db680 Bump version to v0.1.4 2018-04-05 13:13:26 -07:00
Carl Lerche
430d28723f Bump version to v0.1.3 (#248) 2018-03-28 12:50:46 -07:00
Carl Lerche
0cb3e648e9 Bump version to v0.1.2 (#239) 2018-03-13 18:11:11 -07:00
messense
267789da92 Update indexmap to 1.0 (#237) 2018-03-12 10:38:07 -07:00
Carl Lerche
70cf009305 Bump version to v0.1.1 (#236) 2018-03-08 10:06:40 -08:00
Brian Smith
06672cbde9 Upgrade ordermap dependency to indexmap. (#227)
Avoid the need for indexmap-based applications to build ordermap,
which is the old name for indexmap.

Signed-off-by: Brian Smith <brian@briansmith.org>
2018-02-26 20:27:13 -08: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
69bd8828ef Remove mock-io git dependency 2018-01-11 22:46:52 -08:00
Carl Lerche
f27056467c Track rustls / ring 2018-01-11 22:35:47 -08:00
Carl Lerche
983477ea50 Depend on string 0.1 2018-01-11 22:21:19 -08:00
Carl Lerche
54f300907f Update the Cargo.toml 2018-01-11 21:21:53 -08:00
Sean McArthur
aa23a9735d SETTINGS_MAX_HEADER_LIST_SIZE (#206)
This, uh, grew into something far bigger than expected, but it turns out, all of it was needed to eventually support this correctly.

- Adds configuration to client and server to set [SETTINGS_MAX_HEADER_LIST_SIZE](http://httpwg.org/specs/rfc7540.html#SETTINGS_MAX_HEADER_LIST_SIZE)
- If not set, a "sane default" of 16 MB is used (taken from golang's http2)
- Decoding header blocks now happens as they are received, instead of buffering up possibly forever until the last continuation frame is parsed.
- As each field is decoded, it's undecoded size is added to the total. Whenever a header block goes over the maximum size, the `frame` will be marked as such.
- Whenever a header block is deemed over max limit, decoding will still continue, but new fields will not be appended to `HeaderMap`. This is also can save wasted hashing.
- To protect against enormous string literals, such that they span multiple continuation frames, a check is made that the combined encoded bytes is less than the max allowed size. While technically not exactly what the spec suggests (counting decoded size instead), this should hopefully only happen when someone is indeed malicious. If found, a `GOAWAY` of `COMPRESSION_ERROR` is sent, and the connection shut down.
- After an oversize header block frame is finished decoding, the streams state machine will notice it is oversize, and handle that.
  - If the local peer is a server, a 431 response is sent, as suggested by the spec.
  - A `REFUSED_STREAM` reset is sent, since we cannot actually give the stream to the user.
- In order to be able to send both the 431 headers frame, and a reset frame afterwards, the scheduled `Canceled` machinery was made more general to a `Scheduled(Reason)` state instead.

Closes #18 
Closes #191
2018-01-05 09:23:48 -08:00
Sean McArthur
24a796da72 remove unused tokio-timer dependency (#170) 2017-10-27 13:11:06 -07:00
Oliver Gould
1c179f7bf2 Depend on http:0.1 (#141) 2017-10-07 12:34:46 -07:00
Carl Lerche
8911ee2a4b Remove h2-test-support crate (#119)
The h2-test-support caused the unstable flag to always be enabled.
2017-09-25 22:28:39 -07:00
Eliza Weisman
e4b8dde1d3 Split Travis build into stages (#62)
Adds code coverage checking.
2017-09-14 16:33:34 -07:00
Carl Lerche
5c0efcf8c4 Ref count stream state and release when final (#73)
Previously, stream state was never released so that long-lived connections
leaked memory.

Now, stream states are reference-counted and freed from the stream slab
when complete.  Locally reset streams are retained so that received frames
may be ignored.
2017-09-10 16:01:19 -07: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
Carl Lerche
c122e97127 Refactor errors (#46)
This patch does a bunch of refactoring, mostly around error types, but it also
paves the way to allow `Codec` to be used standalone.

* `Codec` (and `FramedRead` / `FramedWrite`) is broken out into a codec module.
* An h2-codec crate is created that re-exports the frame and codec modules.
* New error types are introduced in the internals:
  * `RecvError` represents errors caused by trying to receive a frame.
  * `SendError` represents errors caused by trying to send a frame.
  * `UserError` is an enum of potential errors caused by invalid usage
    by the user of the lib.
  * `ProtoError` is either a `Reason` or an `io::Error`. However it doesn't
    specify connection or stream level.
  * `h2::Error` is an opaque error type and is the only error type exposed
    by the public API (used to be `ConnectionError`).

There are misc code changes to enable this as well. The biggest is a new "sink"
API for `Codec`. It provides buffer which queues up a frame followed by flush
which writes everything that is queued. This departs from the `Sink` trait in
order to provide more accurate error values. For example, buffer can never fail
(but it will panic if `poll_ready` is not called first).
2017-09-02 11:12:50 -07:00
Carl Lerche
9d45255c75 H2 headers must be lower case 2017-08-30 18:16:21 -04: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
Brian Smith
72f1d372af Fix build by upgrading tokio-io dependency to tokio-io 0.1.3. (#23)
tokio-io 0.1.3 has been published so the "replace" for tokio-io 0.1.2 is no longer useful and it breaks the build with some (but apparently not all) versions of Cargo.

Update the dependency to tokio-io 0.1.3 since that is the version that's what's been verified to work.
2017-08-16 21:40:53 -07:00
Carl Lerche
de96b2f410 Add another test 2017-08-16 12:43:48 -07:00
Carl Lerche
32d4c2d5a9 Many more changes 2017-08-11 12:00:22 -07:00
Carl Lerche
e810b30999 Track http crate changes 2017-08-03 10:00:50 -07:00
Carl Lerche
341e15769e Move to custom stream storage 2017-08-02 12:55:41 -07:00
Oliver Gould
bd3a07f9e7 Since ReadySink isn't public yet, expose Connection::is_ready(). (#7)
Also use http from master
2017-07-26 14:15:47 -07:00