[SSHD-827] Close immediately SOCKS channels that were not opened due to exception
Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/0f75d959 Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/0f75d959 Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/0f75d959 Branch: refs/heads/master Commit: 0f75d959d61d42017f09a944e1d97eeef17b2a92 Parents: ec3fa16 Author: jkoscinski <jaroslaw.koscin...@comarch.ok> Authored: Wed Jun 13 07:18:13 2018 +0300 Committer: Lyor Goldstein <lyor.goldst...@gmail.com> Committed: Wed Jun 13 07:54:57 2018 +0300 ---------------------------------------------------------------------- .../src/main/java/org/apache/sshd/common/forward/SocksProxy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/0f75d959/sshd-core/src/main/java/org/apache/sshd/common/forward/SocksProxy.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/common/forward/SocksProxy.java b/sshd-core/src/main/java/org/apache/sshd/common/forward/SocksProxy.java index 45e157e..615a978 100644 --- a/sshd-core/src/main/java/org/apache/sshd/common/forward/SocksProxy.java +++ b/sshd-core/src/main/java/org/apache/sshd/common/forward/SocksProxy.java @@ -166,7 +166,7 @@ public class SocksProxy extends AbstractCloseable implements IoHandler { Throwable t = future.getException(); if (t != null) { service.unregisterChannel(channel); - channel.close(false); + channel.close(true); buffer.putByte((byte) 0x5b); } else { buffer.putByte((byte) 0x5a); @@ -284,7 +284,7 @@ public class SocksProxy extends AbstractCloseable implements IoHandler { Throwable t = future.getException(); if (t != null) { service.unregisterChannel(channel); - channel.close(false); + channel.close(true); response.putByte((byte) 0x01); } else { response.putByte((byte) 0x00);