reset stream if invalid content-length received

This commit is contained in:
Sean McArthur
2017-10-05 17:09:20 -07:00
parent 447102beeb
commit 38900df185

View File

@@ -152,9 +152,10 @@ where
if let Some(content_length) = frame.fields().get(header::CONTENT_LENGTH) { if let Some(content_length) = frame.fields().get(header::CONTENT_LENGTH) {
let content_length = match parse_u64(content_length.as_bytes()) { let content_length = match parse_u64(content_length.as_bytes()) {
Ok(v) => v, Ok(v) => v,
Err(_) => { Err(_) => return Err(RecvError::Stream {
unimplemented!(); id: stream.id,
}, reason: Reason::ProtocolError,
}),
}; };
stream.content_length = ContentLength::Remaining(content_length); stream.content_length = ContentLength::Remaining(content_length);