Skip to content

Commit db7cbdc

Browse files
committed
[SSHD-1158] Don't send channel EOF after having received channel CLOSE
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
1 parent 60b50f9 commit db7cbdc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sshd-core/src/main/java/org/apache/sshd/common/channel/AbstractChannel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ public void handleClose() throws IOException {
547547
}
548548

549549
try {
550-
if (!isEofSent()) {
550+
if (!eofSent.getAndSet(true)) {
551551
if (debugEnabled) {
552552
log.debug("handleClose({}) prevent sending EOF", this);
553553
}
@@ -683,7 +683,7 @@ public String toString() {
683683
@Override
684684
protected void preClose() {
685685
if (!isEofSent()) {
686-
log.debug("close({}) prevent sending EOF", this);
686+
log.debug("close({}) no EOF sent", this);
687687
}
688688

689689
try {

0 commit comments

Comments
 (0)