Skip to content

Commit 54f965a

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

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/proto/streams/recv.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ 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+
// Correctness: never push a stream to `pending_accept` without having the
252+
// corresponding headers frame pushed to `stream.pending_recv`.
251253
self.pending_accept.push(stream);
252254
}
253255
}
@@ -257,7 +259,10 @@ impl Recv {
257259

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

0 commit comments

Comments
 (0)