Skip to content

Commit

Permalink
added some additional comments for clarification.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Rodler committed Jun 16, 2023
1 parent 9a78d6b commit 54f965a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/proto/streams/recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ impl Recv {
// Only servers can receive a headers frame that initiates the stream.
// This is verified in `Streams` before calling this function.
if counts.peer().is_server() {
// Correctness: never push a stream to `pending_accept` without having the
// corresponding headers frame pushed to `stream.pending_recv`.
self.pending_accept.push(stream);
}
}
Expand All @@ -257,7 +259,10 @@ impl Recv {

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

Expand Down

0 comments on commit 54f965a

Please sign in to comment.