check for overly large header field in send_headers

This commit is contained in:
Sean McArthur
2019-05-29 14:40:28 -07:00
parent e512b6ccb6
commit 91819bf25e
5 changed files with 63 additions and 2 deletions

View File

@@ -85,6 +85,10 @@ impl Send {
}
}
if frame.has_too_big_field() {
return Err(UserError::HeaderTooBig);
}
let end_stream = frame.is_end_stream();
// Update the state
@@ -216,6 +220,10 @@ impl Send {
return Err(UserError::UnexpectedFrameType);
}
if frame.has_too_big_field() {
return Err(UserError::HeaderTooBig);
}
stream.state.send_close();
trace!("send_trailers -- queuing; frame={:?}", frame);

View File

@@ -180,8 +180,9 @@ where
Ok(()) => Ok(()),
Err(RecvHeaderBlockError::Oversize(resp)) => {
if let Some(resp) = resp {
let _ = actions.send.send_headers(
let sent = actions.send.send_headers(
resp, send_buffer, stream, counts, &mut actions.task);
debug_assert!(sent.is_ok(), "oversize response should not fail");
actions.send.schedule_implicit_reset(
stream,