Skip to content

Commit

Permalink
[SSHD-1158] Don't send channel EOF after having received channel CLOSE
Browse files Browse the repository at this point in the history
When the peer closes the channel, just reply with a CLOSE message.
Do not send an EOF before the CLOSE. See RFC 4254, section 5.3.[1]

[1] https://tools.ietf.org/html/rfc4254#section-5.3
  • Loading branch information
tomaswolf committed May 5, 2021
1 parent 60b50f9 commit db7cbdc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ public void handleClose() throws IOException {
}

try {
if (!isEofSent()) {
if (!eofSent.getAndSet(true)) {
if (debugEnabled) {
log.debug("handleClose({}) prevent sending EOF", this);
}
Expand Down Expand Up @@ -683,7 +683,7 @@ public String toString() {
@Override
protected void preClose() {
if (!isEofSent()) {
log.debug("close({}) prevent sending EOF", this);
log.debug("close({}) no EOF sent", this);
}

try {
Expand Down

0 comments on commit db7cbdc

Please sign in to comment.