Skip to content

Commit

Permalink
Abort message queueing if peer was disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalinin committed Jul 5, 2018
1 parent 7503803 commit d0365cb
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ public void setChannel(Channel channel) {
}

public void sendMessage(Message msg) {
if (channel.isDisconnected()) {
logger.warn("{}: attempt to send [{}] message after disconnect", channel, msg.getCommand().name());
return;
}

if (msg instanceof PingMessage) {
if (hasPing) return;
hasPing = true;
Expand Down

0 comments on commit d0365cb

Please sign in to comment.