This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 1de38985ae04ee2e3b6ff93ab3b98a5d3a9df706
Author: Andrea Cosentino <[email protected]>
AuthorDate: Fri Nov 16 13:30:25 2018 +0100

    CAMEL-12631 - SFTP: Socket timeout overwrites Server Alive Interval
---
 .../org/apache/camel/component/file/remote/SftpOperations.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
 
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
index c09d633..a7fbaaf 100644
--- 
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
+++ 
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
@@ -354,8 +354,12 @@ public class SftpOperations implements 
RemoteFileOperations<SftpRemoteFile> {
         });
 
         // set the SO_TIMEOUT for the time after the connect phase
-        if (configuration.getSoTimeout() > 0) {
-            session.setTimeout(configuration.getSoTimeout());
+        if (sftpConfig.getServerAliveInterval() == 0) {
+            if (configuration.getSoTimeout() > 0) {
+               session.setTimeout(configuration.getSoTimeout());
+            }
+        } else {
+               LOG.debug("The Server Alive Internal is already set, the socket 
timeout won't be considered to avoid overidding the provided Server alive 
interval value");
         }
 
         // set proxy if configured

Reply via email to