Commit Graph

87 Commits

Author SHA1 Message Date
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
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
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
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
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
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
3ec0e85e56 add test when stream window overflows before conn window 2017-09-13 14:32:27 -07:00
Sean McArthur
ed472f109c add client::Builder to configure Clients 2017-09-13 14:32:27 -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
5c0efcf8c4 Ref count stream state and release when final (#73)
Previously, stream state was never released so that long-lived connections
leaked memory.

Now, stream states are reference-counted and freed from the stream slab
when complete.  Locally reset streams are retained so that received frames
may be ignored.
2017-09-10 16:01:19 -07: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
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
9bb34d907a Thread P generic through all 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
807d2b7317 Wire in recv flow control (#26) 2017-08-23 11:22:24 -07:00
Oliver Gould
e015d7bfba Implement Client::poll_ready (#21)
Client::poll_ready ensures that the connection is ale to to initiate a new request stream to the remote server.  When the server is at capacity, a task is stored to be notified when capacity is available.
2017-08-15 13:46:55 -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
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
a1b03b7724 Trying to get something working 2017-08-10 13:15:40 -07:00
Carl Lerche
dfec401fdf WIP: send flow control 2017-08-09 14:16:32 -07:00
Carl Lerche
87c4d36b0c Delete comments 2017-08-09 11:47:15 -07:00
Carl Lerche
0bf0e79132 Tweaks 2017-08-09 11:43:55 -07:00
Carl Lerche
8f2b69c280 Get server working again (mostly) 2017-08-09 10:36:03 -07:00
Carl Lerche
26df3a3698 Remove P generic from type 2017-08-08 22:11:11 -07:00
Carl Lerche
8485bf91e7 Start hooking up reset 2017-08-08 13:48:29 -07:00
Carl Lerche
314b7a1848 Wire in PushPromise 2017-08-08 13:32:36 -07:00
Carl Lerche
fa66323cec Akamai request kind of works 2017-08-08 09:47:29 -07:00
Carl Lerche
441a8416c6 Handle the remote returning a protocol error 2017-08-07 22:35:29 -07:00
Carl Lerche
71acfe3961 Start hooking up data receiving 2017-08-07 12:17:52 -07:00
Carl Lerche
1c55ad75ea More code 2017-08-04 17:25:39 -07:00
Carl Lerche
fc0a7eb898 More work 2017-08-04 12:12:22 -07:00
Carl Lerche
dd8412d660 Much work 2017-08-03 15:50:13 -07:00
Carl Lerche
7a804601c5 A lot of structural work 2017-08-03 11:40:50 -07:00
Carl Lerche
e810b30999 Track http crate changes 2017-08-03 10:00:50 -07:00
Carl Lerche
9f9bf85168 More restructuring 2017-08-02 14:48:10 -07:00
Carl Lerche
a3cbf2d7ac Wire up Trailers frame 2017-08-02 11:34:34 -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
13d6866ee8 Simplify control streams (#8) 2017-07-26 16:53:31 -07:00
Oliver Gould
bd3a07f9e7 Since ReadySink isn't public yet, expose Connection::is_ready(). (#7)
Also use http from master
2017-07-26 14:15:47 -07:00
Oliver Gould
a4cf406c22 trailing ws 2017-07-24 16:47:24 +00:00
Oliver Gould
5b3f27c5fa Use macros for proxying internal interfaces. 2017-07-23 19:18:14 +00:00
Oliver Gould
df5f31a63c narrow the surface area of the ControlSettings api to expose only a few remote settings 2017-07-23 18:34:50 +00:00
Oliver Gould
bf724bd53e expose ControlPing to Connection 2017-07-22 21:23:24 +00:00
Oliver Gould
f121f747ac tests pass 2017-07-22 21:16:53 +00:00
Oliver Gould
7951def04d fixup tests 2017-07-22 20:23:14 +00:00