Skip to content

Commit 07397f4

Browse files
author
Michael Rodler
committed
added some additional comments for clarification.
1 parent 9a78d6b commit 07397f4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/proto/streams/recv.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ impl Recv {
248248
// Only servers can receive a headers frame that initiates the stream.
249249
// This is verified in `Streams` before calling this function.
250250
if counts.peer().is_server() {
251+
252+
// Correctness: never push a stream to `pending_accept` without having the
253+
// corresponding headers frame pushed to `stream.pending_recv`.
251254
self.pending_accept.push(stream);
252255
}
253256
}
@@ -257,7 +260,10 @@ impl Recv {
257260

258261
/// Called by the server to get the request
259262
///
260-
/// TODO: Should this fn return `Result`?
263+
/// # Panics
264+
///
265+
/// Panics if `stream.pending_recv` has no `Event::Headers` queued.
266+
///
261267
pub fn take_request(&mut self, stream: &mut store::Ptr) -> Request<()> {
262268
use super::peer::PollMessage::*;
263269

0 commit comments

Comments
 (0)