Commit Graph

15 Commits

Author SHA1 Message Date
Sean McArthur
4398e169e8 Update to Tokio 0.2 (#428) 2019-11-27 14:53:57 -08: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
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
1c5d4ded50 Add Graceful Shutdown support
If graceful shutdown is initiated, a GOAWAY of the max stream ID - 1 is
sent, followed by a PING frame, to measure RTT. When the PING is ACKed,
the connection sends a new GOAWAY with the proper last processed stream
ID. From there, once all active streams have completely, the connection
will finally close.
2018-03-29 13:51:30 -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
Sean McArthur
f7d14861e5 rustfmt: add trailing commas in match arms, set fn call to block stle (#85) 2017-09-12 19:29:06 -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
cd76aca6d4 Add test infrastructure to work directly with frames (#56)
This adds a `Codec` based testing API. This is a bit less annoying than writing
at the raw H2 wire protocol level...
2017-09-06 14:18:37 -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
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
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