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
57 lines
1.2 KiB
TOML
57 lines
1.2 KiB
TOML
[package]
|
|
name = "h2"
|
|
version = "0.1.0"
|
|
authors = ["Carl Lerche <me@carllerche.com>"]
|
|
|
|
[badges.travis-ci]
|
|
repository = "carllerche/h2"
|
|
branch = "master"
|
|
|
|
[badges.codecov]
|
|
repository = "carllerche/h2"
|
|
branch = "master"
|
|
service = "github"
|
|
|
|
[features]
|
|
|
|
# Enables **unstable** APIs. Any API exposed by this feature has no backwards
|
|
# compatibility guarantees. In other words, you should not use this feature for
|
|
# anything besides experimentation. Definitely **do not** publish a crate that
|
|
# depends on this feature.
|
|
unstable = []
|
|
|
|
[workspace]
|
|
|
|
[dependencies]
|
|
futures = "0.1"
|
|
tokio-io = "0.1.4"
|
|
bytes = "0.4"
|
|
http = "0.1"
|
|
byteorder = "1.0"
|
|
log = "0.3.8"
|
|
fnv = "1.0.5"
|
|
slab = "0.4.0"
|
|
string = { git = "https://github.com/carllerche/string" }
|
|
ordermap = "0.2"
|
|
|
|
[dev-dependencies]
|
|
mock-io = { git = "https://github.com/carllerche/mock-io", branch = "experiments" }
|
|
|
|
# Fuzzing
|
|
quickcheck = "0.4.1"
|
|
rand = "0.3.15"
|
|
|
|
# HPACK fixtures
|
|
hex = "0.2.0"
|
|
walkdir = "1.0.0"
|
|
serde = "1.0.0"
|
|
serde_json = "1.0.0"
|
|
|
|
# Akamai example
|
|
tokio-core = "0.1"
|
|
env_logger = "0.4.3"
|
|
io-dump = { git = "https://github.com/carllerche/io-dump" }
|
|
rustls = "0.11"
|
|
tokio-rustls = { git = "https://github.com/briansmith/tokio-rustls", tag = "b/p1" }
|
|
webpki-roots = "0.13"
|