Commit Graph

488 Commits

Author SHA1 Message Date
Anthony Ramine
fe938cb81c Fix the macro param name in set_pseudo (fixes #472) (#520) 2021-02-16 11:35:34 -08:00
nickelc
9049e468c8 Remove the obsolent tracing-future dependency (#517) 2021-02-09 05:50:11 -08:00
Eliza Weisman
978c71270a add Connection::max_concurrent_send_streams (#513)
This PR adds accessors to `client::Connection` and `server::Connection`
that return the send stream concurrency limit on that connection, as
negotiated by the remote peer. This is part of issue #512.

I think we probably ought to expose similar accessors for other
settings, but I thought it was better to add each one in a separate,
focused PR.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2021-02-05 09:58:10 -08:00
Eliza Weisman
2c8c847cd5 Replace deprecated compare_and_swap with compare_exchange (#514)
The `compare_and_swap` method on atomics is now deprecated in favor
of `compare_exchange`.

Since the author of #510 closed that PR, this is just #510 with rustfmt run.

I also removed an unnecessary trailing semicolon that the latest rust
compiler now complains about.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>

Co-authored-by: Kornel <kornel@cloudflare.com>
2021-02-05 09:27:27 -08:00
Sean McArthur
b4976675fa Update to Tokio and Bytes 1.0 (#504) 2020-12-23 10:01:44 -08:00
Eliza Weisman
73bf6a61ad re-enable vectored writes (#500)
Tokio's AsyncWrite trait once again has support for vectored writes in
Tokio 0.3.4 (see tokio-rs/tokio#3149.

This branch re-enables vectored writes in h2.

This change doesn't make all that big of a performance improvement in
Hyper's HTTP/2 benchmarks, but they use a BytesMut as the buffer.
With a buffer that turns into more IO vectors in bytes_vectored, there
might be a more noticeable performance improvement.

I spent a bit trying to refactor the flush logic to coalesce into fewer
writev calls with more buffers, but the current implementation seems
like about the best we're going to get without a bigger refactor. It's
basically the same as what h2 did previously, so it's probably fine.
2020-11-23 16:35:48 -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
Sean McArthur
676a068fd4 Prepare for 0.3.x changes 2020-10-23 08:29:04 -07:00
Sean McArthur
3bb01aafae v0.2.7 2020-10-23 08:14:51 -07:00
Yuchen Wu
0ba7d13ae5 Allow responses of HEAD requests to have empty DATA frames (#490) 2020-10-22 14:36:41 -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
Michael Beaumont
d3c2bba18b Increment Stream.refs when sending a push promise 2020-08-17 15:54:47 -07:00
Michael Beaumont
6d80bd454e Fix handling Streams.refs in next_incoming
`Streams.inner.ref` doesn't need to be incremented if we don't
return an `OpaqueStreamRef`.

This prevented the bug in `send_push_promise` from appearing
in the tests.
2020-08-17 15:54:47 -07:00
Sean McArthur
e3a358d696 v0.2.6 2020-07-13 16:56:04 -07:00
David Barsky
d3b9f1e36a feat(lib): switch from log to tracing (#475) 2020-07-07 15:55:24 -07:00
Han Xu
96570bb564 fix documentation for server::Connection 2020-05-14 11:16:29 -07:00
Sean McArthur
ecb31135cb v0.2.5 2020-05-06 13:19:56 -07:00
Sean McArthur
c460c6e581 Change store debug_assert to only run in tests 2020-05-06 12:55:19 -07:00
Sean McArthur
25b2741d2f v0.2.4 2020-03-30 15:23:38 -07:00
Sean McArthur
e41a1f130c Respect SETTINGS_HEADER_TABLE_SIZE (#459) 2020-03-30 11:53:22 -07:00
Sean McArthur
7e1e923542 v0.2.3 2020-03-25 10:23:31 -07:00
Sean McArthur
d6dc63276f Fix receiving a GOAWAY frame from updating the max recv ID
Receiving a GOAWAY should update the max *send* ID, it shouldn't affect
the max recv.
2020-03-25 10:08:13 -07:00
Kornel Lesiński
f7b3cf6d29 Handle :scheme and :path in CONNECT
If the :method is CONNECT the :scheme and :path pseudo-header fields MUST be omitted
2020-03-09 11:21:40 -07:00
Sean McArthur
f7718b5b19 v0.2.2 2020-03-03 12:27:26 -08:00
Sean McArthur
1b01300eeb Use a u32 index for stream store (#451)
A connection can never have more than u32::MAX >> 1 streams, so we'll
never store more than that many in the store slab. Define the
`SlabIndex` as a `u32` to reduce the number of bytes moved around.
2020-02-28 15:30:48 -08:00
Sean McArthur
75a0caf220 fix warning about unnecessary parens 2020-02-17 16:51:03 -08:00
Sean McArthur
8ca2eb2597 Change unused BytesMut::split_to to advance 2020-01-29 15:55:28 -08:00
Sean McArthur
74d02933a5 Fix warnings about deprecated Error::description 2020-01-29 15:55:28 -08:00
Sean McArthur
012dfc6991 v0.2.1 2019-12-06 12:24:07 -08:00
Sean McArthur
ec751f3696 Remove Unpin requirement for the send Buf 2019-12-06 11:40:08 -08:00
Sean McArthur
13e0f17a03 v0.2.0 2019-12-03 12:06:13 -08: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
Sean McArthur
86e53054a6 Change ReserveCapacity to expanded FlowControl type (#423)
- Adds `FlowControl::available_capacity` method.
- Adds `FlowControl::used_capacity` method.
2019-10-08 11:28:15 -07:00
Sean McArthur
3cfcab016e Remove public Error constructor from io::Error (#420) 2019-10-07 15:29:38 -07:00
Sean McArthur
4c1d797712 Add ability to adjust INITIAL_WINDOW_SIZE setting on an existing connection (#421) 2019-10-07 15:29:23 -07:00
Sean McArthur
367206bfa1 Decode debug_data in GOAWAY frames 2019-10-04 12:45:22 -07:00
Sean McArthur
eef0ee52f0 v0.2.0-alpha.3 2019-10-01 08:37:56 -07:00
Sean McArthur
b534a7888a v0.2.0-alpha.2 2019-09-20 14:05:06 -07:00
Michael Beaumont
fac165e451 Add server support for push (#327)
Closes #291, closes #185
2019-09-16 11:30:58 -07:00
Sean McArthur
0527f5b72a Rename 'stream' feature to 'unstable-stream' 2019-09-12 12:44:44 -07:00
Michael Beaumont
06a68a76a2 Use IndexMap::swap_remove instead of deprecated IndexMap::remove 2019-09-12 12:22:17 -07:00
Sean McArthur
8e81d84910 v0.2.0-alpha.1 2019-09-04 11:08:05 -07:00
Sean McArthur
2d90efee17 Prune futures-* dependencies 2019-08-30 14:53:49 -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
b2af3d4b28 Change trailers() to return Result<Option> instead of Option<Result> 2019-08-20 17:32:06 -07:00