Ignore 1xx frames (#521)

Closes #515
This commit is contained in:
Kornel
2021-02-25 16:57:42 +00:00
committed by GitHub
parent 30ca832790
commit 89d91b0a4f
4 changed files with 72 additions and 11 deletions

View File

@@ -161,7 +161,7 @@ impl Recv {
counts: &mut Counts,
) -> Result<(), RecvHeaderBlockError<Option<frame::Headers>>> {
tracing::trace!("opening stream; init_window={}", self.init_window_sz);
let is_initial = stream.state.recv_open(frame.is_end_stream())?;
let is_initial = stream.state.recv_open(&frame)?;
if is_initial {
// TODO: be smarter about this logic
@@ -226,15 +226,17 @@ impl Recv {
let stream_id = frame.stream_id();
let (pseudo, fields) = frame.into_parts();
let message = counts
.peer()
.convert_poll_message(pseudo, fields, stream_id)?;
if !pseudo.is_informational() {
let message = counts
.peer()
.convert_poll_message(pseudo, fields, stream_id)?;
// Push the frame onto the stream's recv buffer
stream
.pending_recv
.push_back(&mut self.buffer, Event::Headers(message));
stream.notify_recv();
// Push the frame onto the stream's recv buffer
stream
.pending_recv
.push_back(&mut self.buffer, Event::Headers(message));
stream.notify_recv();
}
// Only servers can receive a headers frame that initiates the stream.
// This is verified in `Streams` before calling this function.