aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSSHTunnel.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPSSHTunnel.m')
-rw-r--r--Source/SPSSHTunnel.m6
1 files changed, 2 insertions, 4 deletions
diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m
index e6d9729a..46ceea97 100644
--- a/Source/SPSSHTunnel.m
+++ b/Source/SPSSHTunnel.m
@@ -163,7 +163,7 @@
- (void) connect
{
localPort = 0;
-
+
if (connectionState != PROXY_STATE_IDLE) return;
[debugMessages removeAllObjects];
[NSThread detachNewThreadSelector:@selector(launchTask:) toTarget: self withObject: nil ];
@@ -350,12 +350,10 @@
- (void)disconnect
{
if (connectionState == PROXY_STATE_IDLE) return;
-
+
// Before terminating the tunnel, check that it's actually running. This is to accommodate tunnels which
// suddenly disappear as a result of network disconnections.
if ([task isRunning]) [task terminate];
-
- connectionState = PROXY_STATE_IDLE;
if (delegate) [delegate performSelectorOnMainThread:stateChangeSelector withObject:self waitUntilDone:NO];
}