From 5284cc1bf764207343a43effccdcada02c05b2bd Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Sat, 11 Nov 2017 11:41:10 +0100 Subject: Yet another work-around for a Jsch bug: timeouts Jsch 0.1.54 passes on the values from ~/.ssh/config for "ServerAliveInterval" and "ConnectTimeout" as read from the config file to java.net.Socket.setSoTimeout(). That method expects milliseconds, but the values in the config file are seconds! The missing conversion in Jsch means that the timeout is set way too low, and if the server doesn't respond within that very short time frame, Jsch kills the connection and then throws an exception with a message such as "session is down" or "timeout in waiting for rekeying process". As a work-around, do the conversion to milliseconds in the Jsch-facing Config interface of OpenSshConfig. That way Jsch already gets these values as milliseconds. Bug: 526867 Change-Id: Ibc9b93f7722fffe10f3e770dfe7fdabfb3b97e74 Signed-off-by: Thomas Wolf --- .../tst/org/eclipse/jgit/transport/OpenSshConfigTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'org.eclipse.jgit.test/tst/org/eclipse') diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java index d604751fef..8ce3f0f147 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java @@ -343,8 +343,7 @@ public class OpenSshConfigTest extends RepositoryTestCase { assertEquals(h1.getConnectionAttempts(), h2.getConnectionAttempts()); final ConfigRepository.Config c = osc.getConfig("orcz"); assertNotNull(c); - assertSame(c, h1.getConfig()); - assertSame(c, h2.getConfig()); + assertSame(h1.getConfig(), h2.getConfig()); } @Test -- cgit v1.2.3