add support for configuring max frame size

- Adds `max_frame_size` to client and server builders
- Pushes max_frame_size into Codec
- Detects when the Codec triggers an error from a frame too big
- Sends a GOAWAY when FRAME_SIZE_ERROR is encountered reading a frame
This commit is contained in:
Sean McArthur
2017-09-13 14:10:27 -07:00
parent 8984a46a92
commit c32015d48e
13 changed files with 221 additions and 18 deletions

View File

@@ -227,7 +227,7 @@ impl<T, B> FramedWrite<T, B> {
/// Set the peer's max frame size.
pub fn set_max_frame_size(&mut self, val: usize) {
assert!(val <= frame::MAX_MAX_FRAME_SIZE);
assert!(val <= frame::MAX_MAX_FRAME_SIZE as usize);
self.max_frame_size = val as FrameSize;
}