Commit Graph

42 Commits

Author SHA1 Message Date
Anthony Ramine
d92ba1c45b Make SendStream::poll_capacity never return Ok(Some(0)) (#596)
Fixes #270
2022-01-19 10:49:53 -08:00
Anthony Ramine
e9e0f27b80 Add test that would make wait_for_capacity hang if it doesn't loop 2021-12-02 11:52:15 -08:00
Anthony Ramine
87969c1f29 Implement the extended CONNECT protocol from RFC 8441 (#565) 2021-11-24 10:05:10 +01:00
Anthony Ramine
c38c94cb16 Make :status in requests be a stream error 2021-10-19 11:02:44 -07:00
Anthony Ramine
465f0337f8 Refactor errors internals (#556)
h2::Error now knows whether protocol errors happened because the user
sent them, because it was received from the remote peer, or because
the library itself emitted an error because it detected a protocol
violation.

It also keeps track of whether it came from a RST_STREAM or GO_AWAY
frame, and in the case of the latter, it includes the additional
debug data if any.

Fixes #530
2021-09-28 09:04:35 -07:00
Anthony Ramine
61b4f8fc34 Support very large headers
This completely refactors how headers are hpack-encoded.

Instead of trying to be clever, constructing frames on the go
while hpack-encoding, we just make a blob of all the
hpack-encoded headers first, and then we split that blob
in as many frames as necessary.
2021-09-08 10:20:30 -07:00
Sean McArthur
b4976675fa Update to Tokio and Bytes 1.0 (#504) 2020-12-23 10:01:44 -08:00
Paolo Barbolini
5a92f256c0 Upgrade to bytes 0.6 (#497)
* Upgrade to bytes 0.6

* Update Cargo.toml

Co-authored-by: Eliza Weisman <eliza@buoyant.io>

* Update tests/h2-support/Cargo.toml

Co-authored-by: Eliza Weisman <eliza@buoyant.io>

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
2020-11-19 14:38:56 -08:00
João Oliveira
cbbdd305b1 update to tokio 0.3 (#491) 2020-10-23 10:45:09 -07:00
eggyal
2b19acf132 Handle client-disabled server push (#486) 2020-09-17 17:25:31 -07:00
Eliza Weisman
fc7f63f641 start adding tracing spans to internals (#478)
We've adopted `tracing` for diagnostics, but currently, it is just being
used as a drop-in replacement for the `log` crate. Ideally, we would
want to start emitting more structured diagnostics, using `tracing`'s
`Span`s and structured key-value fields.

A lot of the logging in `h2` is already written in a style that imitates
the formatting of structured key-value logs, but as textual log
messages. Migrating the logs to structured `tracing` events therefore is
pretty easy to do. I've also started adding spans, mostly in the read
path.

Finally, I've updated the tests to use `tracing` rather than
`env_logger`. The tracing setup happens in a macro, so that a span for
each test with the test's name can be generated and entered. This will
make the test output easier to read if multiple tests are run
concurrently with `--nocapture`.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-08-17 17:29:22 -07:00
Sean McArthur
e41a1f130c Respect SETTINGS_HEADER_TABLE_SIZE (#459) 2020-03-30 11:53:22 -07:00
Kornel Lesiński
5041a4d428 Test CONNECT is accepted 2020-03-09 11:21:40 -07:00
Sean McArthur
881832cde9 Rename unstable-stream feature to stream (#433) 2019-12-03 10:38:50 -08:00
Sean McArthur
eab9c0b410 Update to http 0.2 (#432) 2019-12-02 16:22:26 -08:00
Sean McArthur
4398e169e8 Update to Tokio 0.2 (#428) 2019-11-27 14:53:57 -08:00
Lucio Franco
9c5bc03908 Update tokio alpha.6 2019-10-01 06:41:28 -07:00
Aaron Hill
b4c129c99d chore(dependencies): update tokio to 0.2.0-alpha.5 (#409) 2019-09-20 13:43:03 -07:00
Sean McArthur
0527f5b72a Rename 'stream' feature to 'unstable-stream' 2019-09-12 12:44:44 -07:00
Sean McArthur
678c90eb0a Update futures and tokio alphas 2019-08-29 15:44:26 -07:00
Gurwinder Singh
85b1f669c0 chore: async_await is stable on nightly 2019-08-21 11:10:03 -07:00
Sean McArthur
a1db5428db Make Stream impls part of optional 'stream' cargo feature (#397) 2019-08-20 16:01:03 -07:00
Gurwinder Singh
f46840f3fa chore: cargo fmt, clippy 2019-08-16 22:27:39 -07:00
Gurwinder Singh
ad7ffa795f Updated as per review comments 2019-08-16 18:47:47 -07:00
Gurwinder Singh
529ef4cd40 Update h2-support 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
Sean McArthur
ab52cf9b30 Send RST_STREAM of STREAM_CLOSED instead of GOAWAY if stream may have been forgotten 2019-06-28 12:48:42 -07:00
Sean McArthur
3e345ac7b6 tests: reduce boilerplate of sending GET requests
This adds a `SendRequestExt` trait to h2-support, with a `get` method
that does a lot of the repeated request building stuff many test cases
were doing.

As a first step, the cleans up stream_states tests to use it.
2019-06-26 16:11:19 -07:00
Sean McArthur
b8f1f0ccf1 Prevent trying to assign capacity to streams that were just reset 2019-05-31 14:56:16 -07:00
Igor Gnatenko
45c4e0336f chore: Update string to 0.2 (#363)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2019-05-31 09:19:20 -07:00
Sean McArthur
a3e59eb7e2 Prevent server Connection from returning same error after calling abrupt shutdown (#352) 2019-04-03 11:41:56 -07:00
Sean McArthur
feff97905f Notify RecvStream tasks if SendStream sends a local reset 2019-03-12 17:17:02 -07:00
Sean McArthur
e3a73f726e Add user PING support (#346)
- Add `share::PingPong`, which can send `Ping`s, and poll for the `Pong`
  from the peer.
2019-02-18 15:59:11 -08:00
Sean McArthur
e656c42353 fix inverted split for DATA frame padding (#330) 2018-11-05 10:20:09 -08: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
Michael Beaumont
586106adf2 Fix push promise frame parsing (#309) 2018-09-17 14:55:37 -07:00
Eliza Weisman
2b960b897d Add Reset::INTERNAL_ERROR helper to test support (#308)
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2018-09-13 16:33:44 -07:00
Sean McArthur
c564273986 fix graceful shutdown to close once idle (#296) 2018-07-30 21:42:00 -07:00
Arvid E. Picciani
74a5e072fe Fix tight loop on aborted connection (#285)
When the underlying IO returns 0 on read, we must stop polling it since
it's closed. Otherwise we'll be stuck in a tight loop.

this fixes https://github.com/sfackler/rust-openssl/issues/949
2018-06-15 16:04:13 -07:00
Carl Lerche
cf62b783e0 Misc bug fixes related to stream state (#273)
This patch includes two new significant debug assertions:

* Assert stream counts are zero when the connection finalizes.
* Assert all stream state has been released when the connection is 
  dropped.

These two assertions were added in an effort to test the fix provided
by #261. In doing so, many related bugs have been discovered and fixed.
The details related to these bugs can be found in #273.
2018-05-09 15:03:21 -07:00
Carl Lerche
b4383b6a8c Add more stream state tests (#271) 2018-05-04 14:11:40 -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