diff src/ch/ethz/ssh2/Connection.java @ 319:776a220dbcc6 ganymed

add ecdsa key support everywhere
author Carl Byington <carl@five-ten-sg.com>
date Thu, 31 Jul 2014 08:20:47 -0700
parents cdb3c9215a9b
children 5afb8c1a54b9
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/Connection.java	Wed Jul 30 17:46:06 2014 -0700
+++ b/src/ch/ethz/ssh2/Connection.java	Thu Jul 31 08:20:47 2014 -0700
@@ -670,27 +670,17 @@
      */
 
     public void close() {
+        Throwable t = new Throwable("Closed due to user request.");
+        close(t, false);
+    }
+
+    public void close(Throwable t, boolean hard) {
         if (cm != null) {
             cm.closeAllChannels();
         }
 
         if (tm != null) {
-            tm.close();
-            tm = null;
-        }
-
-        am = null;
-        cm = null;
-        authenticated = false;
-    }
-
-    public synchronized void close(IOException t) {
-        if (cm != null) {
-            cm.closeAllChannels();
-        }
-
-        if (tm != null) {
-            tm.close(t);
+            tm.close(t, hard == false);
             tm = null;
         }
 
@@ -827,7 +817,7 @@
                             }
 
                             state.timeoutSocketClosed = true;
-                            tm.close(new SocketTimeoutException("The connect timeout expired"));
+                            tm.close(new SocketTimeoutException("The connect timeout expired"), false);
                         }
                     }
                 };