提交 a1898d8b 编写于 作者: K kohsuke

- added a debug method to enable SSH logging.

- disabled SSH connection pooling, which seems to improve the SSH connection stability. I was unable to connect to my intranet server before, but with this change it works now.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5679 71c3de6d-444a-0410-be80-ed276b4c234a
上级 00c2282a
......@@ -231,6 +231,18 @@
<groupId>org.jvnet.hudson.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.1.4-hudson-3</version>
<exclusions>
<!-- replaced by out patched version -->
<exclusion>
<groupId>ch.ethz.ganymed</groupId>
<artifactId>ganymed-ssh2</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jvnet.hudson</groupId>
<artifactId>ganymed-ssh2</artifactId>
<version>build210-hudson-1</version>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
......
package hudson.scm;
import ch.ethz.ssh2.SCPClient;
import hudson.FilePath;
import hudson.FilePath.FileCallable;
import hudson.Launcher;
......@@ -76,6 +77,7 @@ import java.util.Random;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.ConsoleHandler;
import java.util.regex.Pattern;
/**
......@@ -1209,6 +1211,11 @@ public class SubversionSCM extends SCM implements Serializable {
// work around for http://www.nabble.com/Slow-SVN-Checkout-tf4486786.html
if(System.getProperty("svnkit.symlinks")==null)
System.setProperty("svnkit.symlinks","false");
// disable the connection pooling, which causes problems like
// http://www.nabble.com/SSH-connection-problems-p12028339.html
if(System.getProperty("svnkit.ssh2.persistent")==null)
System.setProperty("svnkit.ssh2.persistent","false");
}
}
......@@ -1237,4 +1244,22 @@ public class SubversionSCM extends SCM implements Serializable {
}
private static final Logger LOGGER = Logger.getLogger(SubversionSCM.class.getName());
/**
* Enables trace logging of Ganymed SSH library.
* <p>
* Intended to be invoked from Groovy console.
*/
public static void enableSshDebug(Level level) {
if(level==null) level= Level.FINEST; // default
Logger ganymedLogger = Logger.getLogger(SCPClient.class.getPackage().getName());
ganymedLogger.setLevel(level);
ganymedLogger.setUseParentHandlers(false);
ConsoleHandler handler = new ConsoleHandler();
handler.setLevel(level);
ganymedLogger.addHandler(handler);
ch.ethz.ssh2.log.Logger.logLevel = 100;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册