Commit Graph

193 Commits

Author SHA1 Message Date
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
0cc611df35 Add Codec::set_max_send_frame_size 2017-09-05 14:01:32 -07:00
Carl Lerche
c2e6eb35d8 Track HTTP crate 2017-09-05 10:21:31 -07:00
Carl Lerche
b4fa5134f9 Data frame (#50)
* Rename DataFlag -> DataFlags
* Polish Data frame API
2017-09-05 10:00:05 -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
11df3633a4 Fix build on nightly 2017-08-29 12:20:44 -04:00
Carl Lerche
11d5f95236 Wire in trailers (#34)
Add send and receive trailer support.
2017-08-25 10:20:47 -07:00
Carl Lerche
c0433e8831 Fix tests & bug introduced in previous commit 2017-08-24 16:48:01 -07:00
Carl Lerche
807d2b7317 Wire in recv flow control (#26) 2017-08-23 11:22:24 -07:00
Carl Lerche
a623ab68b5 New send flow control (#25)
Restructure send flow control such that sending data is always accepted by `Stream`. Data frames will be buffered until there is available window to send them. Producers can monitor the available window capacity to decide if data should be produced.
2017-08-21 13:52:58 -07:00
Carl Lerche
de96b2f410 Add another test 2017-08-16 12:43:48 -07:00
Carl Lerche
150c3160be Get large body writes working 2017-08-12 11:02:50 -07:00
Carl Lerche
570962353b Work on prioritization 2017-08-11 21:57:44 -07:00
Carl Lerche
8f2b69c280 Get server working again (mostly) 2017-08-09 10:36:03 -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
71da8d121f Start hooking up sending data 2017-08-07 21:01:15 -07:00
Carl Lerche
6053ee059d Get receiving data working 2017-08-07 12:48:50 -07:00
Carl Lerche
d918215397 Fix test 2017-08-04 22:19:42 -07:00
Carl Lerche
90df6e3879 Try to clean up test 2017-08-04 20:54:49 -07:00
Carl Lerche
650b40fc90 Zomg something works 2017-08-04 17:29:37 -07:00
Carl Lerche
1c55ad75ea More code 2017-08-04 17:25:39 -07:00
Carl Lerche
7a804601c5 A lot of structural work 2017-08-03 11:40:50 -07:00
Carl Lerche
19e562f9e0 Add some test stubs 2017-08-02 11:43:14 -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
0f13836504 More test cleanup 2017-07-26 13:08:00 -07:00
Carl Lerche
5dbeb0703b Start breaking out test files 2017-07-26 12:03:35 -07:00
Oliver Gould
82ba0dde71 update comments 2017-07-23 18:01:02 +00:00
Oliver Gould
4f723fffce clarify stream state management -- pattern matching ftw 2017-07-23 15:51:39 +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
Oliver Gould
067ec846e1 wip 2017-07-22 19:50:17 +00:00
Oliver Gould
d5d47b08ca testing, debugging, making things private 2017-07-22 18:30:32 +00:00
Oliver Gould
c1f9ff8fd8 wip: problems with Frame::len() 2017-07-17 01:07:21 +00:00
Carl Lerche
c061777663 Add large body test 2017-07-12 14:42:08 -07:00
Carl Lerche
36a1c6f045 More tests 2017-07-11 20:50:41 -07:00
Carl Lerche
fab9fa8ed2 More tests 2017-07-11 14:28:40 -07:00
Carl Lerche
4e0e01aa5c More tests 2017-07-11 14:01:25 -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
Carl Lerche
a15f06ea7c Add a test for reading client preface 2017-07-06 18:34:17 -07:00
Carl Lerche
63ffea61f5 Start writing tests 2017-06-29 20:59:21 -07:00