Commit Graph

48 Commits

Author SHA1 Message Date
Kornel Lesiński
5041a4d428 Test CONNECT is accepted 2020-03-09 11:21:40 -07:00
Sean McArthur
c5880076d5 rustfmt some test cases 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
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
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
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
Michael Beaumont
fac165e451 Add server support for push (#327)
Closes #291, closes #185
2019-09-16 11:30:58 -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
Sean McArthur
a1db5428db Make Stream impls part of optional 'stream' cargo feature (#397) 2019-08-20 16:01:03 -07:00
Gurwinder Singh
ad7ffa795f Updated as per review comments 2019-08-16 18:47:47 -07:00
Gurwinder Singh
97a4c8049c Update h2-tests 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
383593a01e allow servers to receive requests without an :authority header 2019-06-17 12:58:50 -07:00
Alex Touchet
e13645c091 Update repo URLs (#370) 2019-06-04 23:06:13 -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
492f4e7f11 Make 'pending reset' streams not count towards active streams 2019-03-12 17:17:02 -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
Eliza Weisman
d6e1fbeed8 Fix race in stream ref count (#338)
Fixes #326
2019-01-11 22:41:35 -08:00
Sean McArthur
c7d4182ffe Release closed streams capacity back to connection (#334)
Previously, any streams that were dropped or closed while not having
consumed the inflight received window capacity would simply leak that
capacity for the connection. This could easily happen if a `RecvStream`
were dropped before fully consuming the data, and therefore a user would
have no idea how much capacity to release in the first place. This
resulted in stalled connections that would never have capacity again.
2018-12-05 09:44:20 -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
Geoffry Song
6d8554a23c Reassign capacity from reset streams. (#320)
I believe this was an oversight - a stream that is reset can still have some
capacity assigned to it (e.g. if said capacity was assigned in the same poll as
the reset), which should be redistributed.
2018-10-16 12:14:42 -07:00
Robert Ying
b116605560 Check whether the send side is not idle, not the recv side (#313)
* Check whether the send side is not idle, not the recv side
* Ensure sure we're handling window updates for the right side
* Add failing test
2018-10-16 12:03:56 -07:00
Geoffry Song
ea8b8ac2fd Avoid prematurely unlinking streams in send_reset, in some cases. (#319)
Because `send_reset` called `recv_err`, which calls `reclaim_all_capacity`,
which eventually calls `transition(stream, ..)` -- all of which happens _before_
the RESET frame is enqueued -- it was possible for the stream to get unlinked
from the store (if there was any connection-level capacity to reassign). This
could then cause the stream to get "leaked" on drop/EOF since it would no longer
be iterated.

Fix this by delaying the call to `reclaim_all_capacity` _after_ enqueueing the
RESET frame.

A test demonstrating the issue is included.
2018-10-16 11:59:22 -07:00
Michael Beaumont
586106adf2 Fix push promise frame parsing (#309) 2018-09-17 14:55:37 -07:00
Sean McArthur
12028cc418 fix panic when calling reserve_capacity after connection closes (#302) 2018-08-08 15:43:47 -07:00
Geoffry Song
d2aa9197f9 Fix the handling of incoming SETTINGS_INITIAL_WINDOW_SIZE. (#299) 2018-08-03 16:00:13 -07:00
Sean McArthur
c564273986 fix graceful shutdown to close once idle (#296) 2018-07-30 21:42:00 -07:00
Geoffry Song
fdfb873438 Prevent pending_open streams from being released. (#295)
* Prevent `pending_open` streams from being released.

This fixes a panic that would otherwise occur in some cases. A test
demonstrating said panic is included.

* Clear the pending_open queue together with everything else.
2018-07-23 15:41:54 -07:00
Carl Lerche
df69c0455a Fix spurrious test failure (#288)
There was a race condition in the test where the server connection
sometimes closed before the final client opereation. This triggered an
unwrap in the test.

This patch updates the test to ensuree that the mock server connection
stays open until the client test is complete.
2018-06-18 11:20:18 -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
Geoffry Song
23234fa14f Promote SendRequest::pending to an OpaqueStreamRef. (#281)
Because `self.pending` doesn't necessarily get cleaned up in a timely fashion -
rather, only when the user calls `poll_ready()` - it was possible for it to
refer to a stream that has already been closed. This would lead to a panic the
next time that `poll_ready()` was called.

Instead, use an `OpaqueStreamRef`, bumping the refcount.

A change to an existing test is included which demonstrates the issue.
2018-06-06 10:16:22 -07:00
Sean McArthur
3a4633d205 add SendResponse::poll_reset and SendStream::poll_reset to listen for reset streams (#279) 2018-05-30 22:57:43 +02:00
johnklai1
6e63d7bae2 Wakeup waiting tasks when transitioning a stream from pending_open (#277) 2018-05-22 15:42:41 -07:00
Carl Lerche
bb454e017c Enforce monotonic stream IDs for push promises (#275)
Previously, monotonic stream IDs (spec 5.1.1) for push promises were not
enforced. This was due to push promises going through an entirely
separate code path than normally initiated streams.

This patch unifies the code path for initializing streams via both
HEADERS and PUSH_PROMISE. This is done by first calling `recv.open` in
both cases.

Closes #272
2018-05-14 10:20:57 -07:00
Carl Lerche
173f9a67e7 Include fuzz testing setup (#274) 2018-05-10 14:48:02 -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