Correct errors on illegal stream limits

This commit is contained in:
Benjamin Saunders
2020-05-22 14:32:48 -07:00
committed by Dirkjan Ochtman
parent 5329a047ab
commit 7f7717ba46
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -2136,6 +2136,11 @@ where
);
}
Frame::StreamsBlocked { dir, limit } => {
if limit > MAX_STREAM_COUNT {
return Err(TransportError::FRAME_ENCODING_ERROR(
"unrepresentable stream limit",
));
}
debug!(
"peer claims to be blocked opening more than {} {} streams",
limit, dir
+1 -1
View File
@@ -642,7 +642,7 @@ impl Streams {
pub fn received_max_streams(&mut self, dir: Dir, count: u64) -> Result<(), TransportError> {
if count > MAX_STREAM_COUNT {
return Err(TransportError::STREAM_LIMIT_ERROR(
return Err(TransportError::FRAME_ENCODING_ERROR(
"unrepresentable stream limit",
));
}