Commit Graph

13 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
Gurwinder Singh
f4dec6efa4 chore: 2018 edition clean up (#386) 2019-07-25 10:30:52 -07:00
Jakub Beránek
db6b841e67 Update crate to Rust 2018 (#383) 2019-07-23 10:18:43 -07:00
Sean McArthur
dabd58fd58 use newest hpack index when repeating a header name 2019-05-15 13:32:07 -07:00
Sean McArthur
aa23a9735d SETTINGS_MAX_HEADER_LIST_SIZE (#206)
This, uh, grew into something far bigger than expected, but it turns out, all of it was needed to eventually support this correctly.

- Adds configuration to client and server to set [SETTINGS_MAX_HEADER_LIST_SIZE](http://httpwg.org/specs/rfc7540.html#SETTINGS_MAX_HEADER_LIST_SIZE)
- If not set, a "sane default" of 16 MB is used (taken from golang's http2)
- Decoding header blocks now happens as they are received, instead of buffering up possibly forever until the last continuation frame is parsed.
- As each field is decoded, it's undecoded size is added to the total. Whenever a header block goes over the maximum size, the `frame` will be marked as such.
- Whenever a header block is deemed over max limit, decoding will still continue, but new fields will not be appended to `HeaderMap`. This is also can save wasted hashing.
- To protect against enormous string literals, such that they span multiple continuation frames, a check is made that the combined encoded bytes is less than the max allowed size. While technically not exactly what the spec suggests (counting decoded size instead), this should hopefully only happen when someone is indeed malicious. If found, a `GOAWAY` of `COMPRESSION_ERROR` is sent, and the connection shut down.
- After an oversize header block frame is finished decoding, the streams state machine will notice it is oversize, and handle that.
  - If the local peer is a server, a 431 response is sent, as suggested by the spec.
  - A `REFUSED_STREAM` reset is sent, since we cannot actually give the stream to the user.
- In order to be able to send both the 431 headers frame, and a reset frame afterwards, the scheduled `Canceled` machinery was made more general to a `Scheduled(Reason)` state instead.

Closes #18 
Closes #191
2018-01-05 09:23:48 -08: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
c2e6eb35d8 Track HTTP crate 2017-09-05 10:21:31 -07:00
Carl Lerche
9d45255c75 H2 headers must be lower case 2017-08-30 18:16:21 -04:00
Carl Lerche
fa66323cec Akamai request kind of works 2017-08-08 09:47:29 -07:00
Carl Lerche
a203365d79 Switch to string crate (#6) 2017-07-26 13:20:26 -07:00
Carl Lerche
a7b92d5ec2 Restructure hpack tests 2017-06-29 23:11:35 -07:00