diff options
author | rowanbeentje <rowan@beent.je> | 2009-06-06 23:25:06 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-06-06 23:25:06 +0000 |
commit | ab4d3557db6d823275b688ccb7210830f029fd5c (patch) | |
tree | cf0ba9733d03868c22d81904d4486ed2de350f4c /Source/CMMCPConnection.m | |
parent | 2f5c4b9bab18b54f2d37f4b4a05afa116cfd0c44 (diff) | |
download | sequelpro-ab4d3557db6d823275b688ccb7210830f029fd5c.tar.gz sequelpro-ab4d3557db6d823275b688ccb7210830f029fd5c.tar.bz2 sequelpro-ab4d3557db6d823275b688ccb7210830f029fd5c.zip |
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
Diffstat (limited to 'Source/CMMCPConnection.m')
-rw-r--r-- | Source/CMMCPConnection.m | 8 |
1 files changed, 6 insertions, 2 deletions
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]; |