Commit Graph

295 Commits

Author SHA1 Message Date
Oliver Gould
80e3478c00 Use remote window size for send flow control (#145)
The initial window size of both the send and recv flow controllers are
configured from the same setting. The send flow controller should be
configured from the remote's initial window size.
2017-10-09 15:16:22 -07:00
Carl Lerche
4c7ecf158d Add ReleaseCapacity handle. (#148)
This enables releasing stream capacity without having the `Body` handle.
2017-10-09 14:00:28 -07:00
Carl Lerche
56db50526d Don't unwrap logger init in tests 2017-10-09 13:10:52 -07:00
Sean McArthur
08a642ab11 fix ICE when compiling prioritization tests (#147) 2017-10-09 13:05:15 -07:00
Carl Lerche
be5f1d702a Fix doc link in README 2017-10-09 11:21:05 -07:00
Holt Chesley
2aee78c7d7 Issue 128: Convert frame::Reason to struct (#142)
Alter frame::Reason to a struct with a single u32 member.
Introduce Constants to the impl for existing Reasons. Change all usage
in the library and its tests to adopt this change,
using the new constants.
2017-10-08 13:13:07 -07:00
Oliver Gould
1c179f7bf2 Depend on http:0.1 (#141) 2017-10-07 12:34:46 -07:00
Sean McArthur
bc679035f9 remove panic from Debug of StreamRef is mutex is poisoned 2017-10-06 14:20:32 -07:00
Sean McArthur
7b81be04aa reduce available window capacity when settings lowers window size 2017-10-06 14:20:32 -07:00
Sean McArthur
431442735d reset streams when receiving invalid psuedo headers 2017-10-06 13:48:30 -07:00
Sean McArthur
7d1732a70d change unimplemented to unreachable in handshake 2017-10-06 09:59:03 -07:00
Sean McArthur
9737d0c6a0 convert several unimplemented into proper asserts 2017-10-06 09:59:03 -07:00
Sean McArthur
38900df185 reset stream if invalid content-length received 2017-10-06 09:59:03 -07:00
Sean McArthur
447102beeb return PayloadTooBig if user calls send_data with buffer over max window size 2017-10-06 09:59:03 -07:00
Sean McArthur
7ad29932f6 change huffman unimplemented to return Err in decode4 2017-10-06 09:59:03 -07:00
Sean McArthur
720fb20bbf remove unused pieces from PingPong (#134)
Adds some extra tests as well, to be sure.
2017-10-05 19:16:14 -07:00
Eliza Weisman
2e3dcf602c StreamRef sends RST_STREAM on drop (#109)
This PR modifies the `Drop` implementation for `StreamRef` to reset the underlying stream if it is the last reference to that stream. Since both `Stream` and `Body` are internally just a `StreamRef`, this means they will both reset the stream on drop; thus, this closes #100.

The assertion that the store no longer contains the dropped stream ID at the end of the `Drop` method  had to be removed, as the stream has to be reset from inside of a `transition` block (which now manages releasing that ID for us), and the `transition` closure moves the value of `stream`, making the assertion no longer possible.

Modifications to some of the tests in `flow_control.rs` were also necessary, in order to prevent `StreamRef`s from being dropped too early.
2017-10-05 18:05:18 -05:00
Sean McArthur
ecd2764f4b when receiving a GOAWAY, allow earlier streams to still process (#133)
Once all active streams have finished, send a GOAWAY back and close the
connection.
2017-10-05 15:32:13 -07:00
Sean McArthur
c4ca8f7def Client::poll_ready and send_request may return Connection Errors (#132)
Closes #131
2017-10-04 15:22:10 -07:00
Sean McArthur
9e1a0c63cf add send_reset to client::Stream (#127)
Closes #99
2017-09-29 11:37:23 -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
Sean McArthur
510800ef28 remove rustfmt from CI while its unstable (#126) 2017-09-28 16:27:24 -07:00
Eliza Weisman
307ad46ead Set codecov pass threshold to 5% (#124) 2017-09-28 10:55:29 -07:00
Eliza Weisman
c1fbabf686 Make CI build flatter (and therefore faster) (#123)
Now with a fancier script for running h2spec
will ensure that the server executable is killed when h2spec finishes,
de-interleaves h2spec & example server stdout
2017-09-27 14:20:08 -07:00
Eliza Weisman
a54b89a84f Run h2spec on CI (#121) 2017-09-26 12:41:59 -07:00
Oliver Gould
0b289fd55d Fix stream-id double-accounting bug (#112)
Both Recv::open and Rev::recv_headers check new stream ids against the
previously stream id. The second such check fails.

Now, only Recv::open performs stream id checks.

Fixes #110
2017-09-26 10:42:12 -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
Oliver Gould
549d96a36b Only run tests once in CI (#117)
* Only run tests once in CI

We run codecov after successful test runs. This ~doubles the length of
CI jobs, sicne the codecov run reproduces nearly all tests.

To avoid this, we just run the codecov tests as part of our normal test
script.

* s/before_script/install

* only publish coverage after test completes

* run all tests for coverage

* remove hpack from coverage

* fix tyop

* cargo clean
2017-09-25 16:39:55 -07:00
Oliver Gould
4f4fa3ea52 Update so dependents can compile (#111)
Add missing `unstable` flag to fns.
2017-09-25 14:07:31 -07:00
Oliver Gould
b99c513334 Apply rustfmt to test/support crate (#116) 2017-09-25 08:29:54 -07:00
Oliver Gould
dad113e17b Disallow nightly failures (#115)
Always install rustfmt since nightly may change underneath it, causing
linking to break.

Apply rustfmt
2017-09-24 19:25:50 -07:00
Eliza Weisman
a72a6bc8f0 Rewrite flow control tests to use newer mock API (#108)
I've rewritten the tests `flow_control::stream_close_by_data_frame_releases_capacity()` and `flow_control::stream_close_by_trailers_frame_releases_capacity()` to use the new mock API. This will make modifying these tests a bit easier in order to expect the correct behavior in my reset-on-drop branch.
2017-09-21 12:58:50 -05:00
Sean McArthur
6ec7f38cd7 add test for client sending over max concurrent limit (#105) 2017-09-19 15:31:35 -07:00
Sean McArthur
db8c109817 Client::poll_ready() returns an Error if next stream ID would overflow (#103)
Closes #102
2017-09-19 14:16:32 -07:00
Sean McArthur
0c8bd75224 check for StreamId overflow (#68) 2017-09-19 13:10:48 -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
Eliza Weisman
9812894709 Add fixtures, examples, util, and src/hpack/test to Codecov ignore list (#96)
We don't care about covering code in these directories, so exclude them from test coverage.
2017-09-18 15:02:18 -05:00
Sean McArthur
71b246a0fb Merge pull request #91 from seanmonstar/config-push-promise
add Client config to disable server push
2017-09-18 11:16:49 -07:00
Sean McArthur
21f7e54ce8 load headers when receiving PushPromise frames 2017-09-18 10:49:35 -07:00
Sean McArthur
a8a4cd2be1 add Client config to disable server push
- Adds `Client::builder().enable_push(false)` to disable push
- Client sends a GO_AWAY if receiving a push when it's disabled
2017-09-18 10:49:35 -07:00
Sean McArthur
ed4e67c1a4 Merge pull request #93 from seanmonstar/codec-unstable
remove unstable for Codec methods used internally
2017-09-18 10:03:58 -07:00
Sean McArthur
92030f634f remove unstable for Codec methods used internally 2017-09-17 14:28:45 -07:00
Oliver Gould
1022e04276 Merge pull request #94 from carllerche/ver/clone-builders
Derive Clone for Builder types
2017-09-17 14:15:24 -07:00
Oliver Gould
303b896095 Derive Clone for Builder types 2017-09-17 20:38:55 +00:00
Sean McArthur
a8e117d09f Merge pull request #88 from seanmonstar/config-max-frame-size
Configure max frame size
2017-09-14 17:29:49 -07:00
Sean McArthur
c32015d48e add support for configuring max frame size
- Adds `max_frame_size` to client and server builders
- Pushes max_frame_size into Codec
- Detects when the Codec triggers an error from a frame too big
- Sends a GOAWAY when FRAME_SIZE_ERROR is encountered reading a frame
2017-09-14 17:03:43 -07:00
Sean McArthur
8984a46a92 Merge pull request #87 from seanmonstar/server-config
add Server Builder
2017-09-14 16:59:37 -07:00
Sean McArthur
7531e5276b add Server Builder 2017-09-14 16:36:51 -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
f84a1bdd1f Notify connection on connection window expansion (#86)
When capacity is released back to the connection and a connection level
window update needs to be sent out, the connection task needs to be
notified in order for the send to actually happen.
2017-09-14 13:50:52 -07:00