diff src/ch/ethz/ssh2/Connection.java @ 373:2768eb029d73

debug kex error
author Carl Byington <carl@five-ten-sg.com>
date Mon, 04 Aug 2014 13:08:22 -0700
parents 20d0a1356c43
children
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/Connection.java	Mon Aug 04 12:11:12 2014 -0700
+++ b/src/ch/ethz/ssh2/Connection.java	Mon Aug 04 13:08:22 2014 -0700
@@ -672,13 +672,16 @@
      * run forever.
      */
 
-    public synchronized void close() {
+    // cannot be synchronized, since Connection.connect() is synchronized, and
+    // if the key exchange fails, another thread will try to close().
+
+    public void close() {
         log.debug("Connection.close()");
         Throwable t = new Throwable("Closed due to user request.");
         close(t, false);
     }
 
-    public synchronized void close(Throwable t, boolean hard) {
+    public void close(Throwable t, boolean hard) {
         log.debug(String.format("Connection.close(%s hard=%b)", t.getMessage(), hard));
         if (cm != null) {
             cm.closeAllChannels();