[CAMEL-8718] Do not disconnect if connected & logged in

(cherry picked from commit 5553474960c83ed8828ed252031818c050a6436f)
(cherry picked from commit 4b03939afdc00120252a368acf504e333d750be9)


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/aef88ab1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/aef88ab1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/aef88ab1

Branch: refs/heads/camel-2.14.x
Commit: aef88ab1cde8bc8379041b8d65b1d31d58a21335
Parents: c18c415
Author: Grzegorz Grzybek <[email protected]>
Authored: Wed Apr 29 12:22:58 2015 +0200
Committer: Grzegorz Grzybek <[email protected]>
Committed: Wed Apr 29 13:15:31 2015 +0200

----------------------------------------------------------------------
 .../org/apache/camel/component/file/remote/RemoteFileConsumer.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/aef88ab1/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java
----------------------------------------------------------------------
diff --git 
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java
 
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java
index 80e2d1e..9408ea4 100644
--- 
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java
+++ 
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java
@@ -162,7 +162,7 @@ public abstract class RemoteFileConsumer<T> extends 
GenericFileConsumer<T> {
 
         try {
             // we may as well be connected, but not logged in. let's 
disconnect to prevent connection leak
-            if (getOperations().isConnected()) {
+            if (!isConnected && getOperations().isConnected()) {
                 getOperations().disconnect();
             }
         } catch (Exception ex) {

Reply via email to