From ab4d3557db6d823275b688ccb7210830f029fd5c Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 6 Jun 2009 23:25:06 +0000 Subject: Further SSH tunnel improvements: - Redesigned SSH key authentication dialog - Added ability to add SSH key passphrases to keychain (sharing details with system SSH) - SSH tunnels with keys which fail are now correctly restarted, interacting with the GUI as necessary - GUI interaction now performed on the main thread for increased stability --- Source/CMMCPConnection.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Source/CMMCPConnection.m') diff --git a/Source/CMMCPConnection.m b/Source/CMMCPConnection.m index 478d5684..8fbf948d 100644 --- a/Source/CMMCPConnection.m +++ b/Source/CMMCPConnection.m @@ -355,7 +355,7 @@ static void forcePingTimeout(int signalNumber); [connectionTunnel setConnectionStateChangeSelector:nil delegate:nil]; if ([connectionTunnel state] != SPSSH_STATE_IDLE) [connectionTunnel disconnect]; [connectionTunnel connect]; - NSDate *tunnelStartDate = [NSDate date]; + NSDate *tunnelStartDate = [NSDate date], *interfaceInteractionTimer; // Allow the tunnel to attempt to connect in a loop while (1) { @@ -367,7 +367,11 @@ static void forcePingTimeout(int signalNumber); [connectionTunnel disconnect]; break; } - [NSThread sleepForTimeInterval:0.25]; + + // Process events for a short time, allowing dialogs to be shown but waiting for the tunnel + interfaceInteractionTimer = [NSDate date]; + [[NSRunLoop currentRunLoop] runMode:NSModalPanelRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.25]]; + tunnelStartDate = [tunnelStartDate addTimeInterval:([[NSDate date] timeIntervalSinceDate:interfaceInteractionTimer] - 0.25)]; } currentSSHTunnelState = [connectionTunnel state]; [connectionTunnel setConnectionStateChangeSelector:@selector(sshTunnelStateChange:) delegate:self]; -- cgit v1.2.3