Basic PRIORITY frame validation. (#71)

Motivation:

In the future we'll want to use PRIORITY frames to provide feedback on
how we emit data. Additionally, RFC 7540 forbids certain kinds of
PRIORITY frame, which right now we tolerate receiving. We can design a
minor PRIORITY shim to ensure that we have a code path for PRIORITY data
to be passed around, and then use this shim to enforce RFC 7540's
requirements.

Modifications:

- Added support for PRIORITY frame data inbound.
- Enforce that frames may not establish self-dependency.

Result:

Better policing of RFC 7540 constraints.
This commit is contained in:
Cory Benfield authored and Johannes Weiss committed 2019-03-25 18:09:46 +00:00
1 parent ed9244267b
commit c2c39c63f6
10 files changed
+137 -3

No files matched your search

+11 -1
View File
@@ -184,12 +184,22 @@ public enum NIOHTTP2Errors {
/// A :status header was received with an invalid value.
public struct InvalidStatusValue: NIOHTTP2Error {
var value: String
public var value: String
public init(_ value: String) {
self.value = value
}
}
/// A priority update was received that would create a PRIORITY cycle.
public struct PriorityCycle: NIOHTTP2Error {
/// The affected stream ID.
public var streamID: HTTP2StreamID
public init(streamID: HTTP2StreamID) {
self.streamID = streamID
}
}
}