Skip to content

Commit

Permalink
No longer accept to send after close
Browse files Browse the repository at this point in the history
  • Loading branch information
najamelan committed Sep 12, 2019
1 parent 534a2b1 commit bed9bd4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ impl WebSocketContext {
Stream: Read + Write,
{
// Do not write to already closed connections.
self.state.check_active()?;
if !self.state.is_active() {
return Err(Error::AlreadyClosed);
}

if let Some(max_send_queue) = self.config.max_send_queue {
if self.send_queue.len() >= max_send_queue {
Expand Down

0 comments on commit bed9bd4

Please sign in to comment.