mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 07:40:55 +03:00
AbstractChannel#close() should be no-op if already closed. Fixes #53.
This commit is contained in:
@@ -258,13 +258,15 @@ public abstract class AbstractChannel
|
||||
throws ConnectionException, TransportException {
|
||||
openCloseLock.lock();
|
||||
try {
|
||||
try {
|
||||
sendClose();
|
||||
} catch (TransportException e) {
|
||||
if (!closeEvent.inError())
|
||||
throw e;
|
||||
if (isOpen()) {
|
||||
try {
|
||||
sendClose();
|
||||
} catch (TransportException e) {
|
||||
if (!closeEvent.inError())
|
||||
throw e;
|
||||
}
|
||||
closeEvent.await(conn.getTimeout(), TimeUnit.SECONDS);
|
||||
}
|
||||
closeEvent.await(conn.getTimeout(), TimeUnit.SECONDS);
|
||||
} finally {
|
||||
openCloseLock.unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user