Permalink
Browse files

Don't try to send a disconnect packet if never connected. Fixes GH-67.

  • Loading branch information...
1 parent 5046370 commit 93e23f4cfb7cccfa37e32ef1a65fb3b04f33857b @shikhar shikhar committed Apr 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/main/java/net/schmizz/sshj/transport/TransportImpl.java
View
2 src/main/java/net/schmizz/sshj/transport/TransportImpl.java
@@ -381,7 +381,7 @@ public void disconnect(DisconnectReason reason) {
public void disconnect(DisconnectReason reason, String message) {
close.lock();
try {
- if (!close.isSet()) {
+ if (isRunning()) {
disconnectListener.notifyDisconnect(reason);
getService().notifyError(new TransportException(reason, "Disconnected"));
sendDisconnect(reason, message);

0 comments on commit 93e23f4

Please sign in to comment.