reset streams when receiving invalid psuedo headers

This commit is contained in:
Sean McArthur
2017-10-06 10:54:49 -07:00
parent 7d1732a70d
commit 431442735d
6 changed files with 55 additions and 6 deletions

View File

@@ -1,8 +1,13 @@
use h2::client;
use super::string::{String, TryFrom};
use bytes::Bytes;
use futures::{Async, Future, Poll};
pub fn byte_str(s: &str) -> String<Bytes> {
String::try_from(Bytes::from(s)).unwrap()
}
pub fn wait_for_capacity(stream: client::Stream<Bytes>, target: usize) -> WaitForCapacity {
WaitForCapacity {
stream: Some(stream),