Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ pub struct ClientStream {
stream: SplitStream<Connection>,
// In case the client stream also handles outgoing messages.
outgoing: Option<Outgoing>,

terminated: bool,
}

impl ClientStream {
Expand All @@ -453,11 +455,16 @@ impl ClientStream {

Ok(output)
}

/// marks this stream as terminated
pub fn set_terminated(&mut self) {
self.terminated = true;
}
}

impl FusedStream for ClientStream {
fn is_terminated(&self) -> bool {
false
self.terminated
}
}

Expand Down Expand Up @@ -992,6 +999,7 @@ impl Client {
state: Arc::clone(&self.state),
stream,
outgoing: self.outgoing.take(),
terminated: false,
})
}

Expand Down