Commit Graph

48 Commits

Author SHA1 Message Date
Michael Beaumont
fac165e451 Add server support for push (#327)
Closes #291, closes #185
2019-09-16 11:30:58 -07:00
Gurwinder Singh
f46840f3fa chore: cargo fmt, clippy 2019-08-16 22:27:39 -07:00
Jakub Beránek
db6b841e67 Update crate to Rust 2018 (#383) 2019-07-23 10:18:43 -07:00
Sean McArthur
1a8015da4a Reduce noise in Debug for Frame (#329) 2018-11-01 13:26:55 -07:00
walfie
73b4c03b55 Fix typos (#223) 2018-02-13 21:00:09 -08:00
Sean McArthur
0c8bd75224 check for StreamId overflow (#68) 2017-09-19 13:10:48 -07:00
Oliver Gould
897bf84163 Use rustfmt to enforce consistent formatting
This change adds a .rustfmt.toml that includes ALL supported settings,
12 of which we have overridden to attempt to cater to our own
proclivities.

rustfmt is checked in the rust-nightly CI job.
2017-09-12 22:29:35 +00:00
Carl Lerche
38bbf30b2f Fix bug in prioritization (#63)
The stream buffered data counter was never decremented.
2017-09-07 14:12:21 -07:00
Carl Lerche
0cc611df35 Add Codec::set_max_send_frame_size 2017-09-05 14:01:32 -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
2452cc4423 Validate & convert messages before buffering
Malformed requests and responses should immediately result in a
RST_STREAM. To support this, received header frames are validated and
converted to Request / Response values immediately on receipt and before
buffering.
2017-08-30 18:16:21 -04:00
Carl Lerche
14f35f1be6 Handle malformed HEADERS 2017-08-30 18:16:21 -04:00
Carl Lerche
b0e6867877 Fix warnings 2017-08-24 15:52:01 -07:00
Carl Lerche
7e8c7fd2b8 Use FlowControl::available to size data frames (#29) 2017-08-23 20:34:58 -07:00
Carl Lerche
807d2b7317 Wire in recv flow control (#26) 2017-08-23 11:22:24 -07:00
Carl Lerche
8a15663ed2 Progress towards allowing large writes 2017-08-11 16:57:51 -07:00
Carl Lerche
32d4c2d5a9 Many more changes 2017-08-11 12:00:22 -07:00
Carl Lerche
012646ab46 Validate settings 2017-08-10 23:25:36 -07:00
Carl Lerche
23b2ef49cc Stub out priority 2017-08-10 23:17:21 -07:00
Carl Lerche
a61562f6b8 Add GoAway support 2017-08-10 14:19:46 -07:00
Carl Lerche
dfec401fdf WIP: send flow control 2017-08-09 14:16:32 -07:00
Carl Lerche
71acfe3961 Start hooking up data receiving 2017-08-07 12:17:52 -07:00
Carl Lerche
33bdc057d6 Restructure proto
The existing code has been moved out and is being copied back piece / by
piece while restructuring the code to (hopefully) be more manageable.
2017-08-02 09:42:10 -07:00
Oliver Gould
d5d47b08ca testing, debugging, making things private 2017-07-22 18:30:32 +00:00
Oliver Gould
ab4f85ea2f wip: stream state management seems good, but tests fail 2017-07-22 17:30:40 +00:00
Oliver Gould
8453435422 wip: improve split stream tracking 2017-07-21 01:30:39 +00:00
Oliver Gould
44edd6a4d4 clear some warnings 2017-07-20 18:29:36 +00:00
Oliver Gould
a62d3dda54 wip: refactor, compiles 2017-07-20 14:51:27 +00:00
Oliver Gould
fb4f0bc5af resets too 2017-07-17 08:18:38 +00:00
Oliver Gould
41ffd1d44f closer to flow control 2017-07-12 21:04:58 +00:00
Oliver Gould
b9f3556070 Merge branch 'master' into ver/flowio 2017-07-10 01:15:36 +00:00
Oliver Gould
d7b82cd50b wip 2017-07-09 06:01:42 +00:00
Carl Lerche
6d1d54f104 Stub out window update 2017-07-08 22:36:24 -07:00
Carl Lerche
981af88838 Get data frames working 2017-07-08 22:23:44 -07:00
Carl Lerche
f6b6d0c7e8 Start state transition verification + refactors 2017-07-07 10:33:04 -07:00
Oliver Gould
7f21954724 Implement ping_pong (#1)
* comments

* wip

* wip

* Sketch out pingpong and keepalive stack modules

PingPong responds to ping requests with acknowledgements.
KeepAlive issues ping requests on idle connections.

* remove keepalive for now

* commentary

* prettify ping_pong's poll

* test ping pong and passthrough

* add buffering test

* Use a fixed-size slice for ping payloads

* Improve pong dispatch

pong messages should be buffered until Stream::poll returns
Async::NotReady or Async::Ready(None) (i.e. such that it is not expected
to be polled again).  pong messages are now dispatched when no more data
may be polled or the Sink half is activated.

* revert name change

* touchup

* wip

* Simplify Stream::poll

Now PingPong only holds at most one pending pong and the stream will not
produce additional frames unti the ping has been sent.

Furthermore, we shouldn't have to call inner.poll_complete quite so
frequently.

* avoid Bytes::split_to

* only use buf internally to Ping::load
2017-06-30 13:58:14 -07:00
Carl Lerche
fee43a09c8 Fix warnings 2017-06-27 12:23:57 -07:00
Carl Lerche
1f85d54cff Process response 2017-06-27 01:34:37 -07:00
Carl Lerche
7897b770e9 Get a request sent 2017-06-26 22:25:25 -07:00
Carl Lerche
fa21970656 Much work 2017-06-23 13:13:50 -07:00
Carl Lerche
a3950354aa Header frame decoding 2017-06-20 09:16:21 -07:00
Carl Lerche
29951da962 FramedWrite 2017-06-19 13:34:08 -07:00
Carl Lerche
f6fd6a6d6e Bunch of work 2017-06-16 16:37:51 -07:00
Carl Lerche
769f3f142f More work 2017-03-11 12:59:15 -08:00
Carl Lerche
0e35254bd8 WIP 2017-03-10 15:14:55 -08:00
Carl Lerche
e2871d92fa Work 2017-03-10 13:02:04 -08:00
Carl Lerche
1fe3a57338 Initial commit 2017-03-09 20:02:47 -08:00