From 06e417594cd0fcdede2f0713c63a861bc65d7e99 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 31 Mar 2010 23:35:06 +0000 Subject: - Improve SPSSHTunnel question/password dialogs to no longer eat 100% CPU by switching from NSCondition blocking to NSLock blocking - Improve behaviour of SSH tunnels with no password in keychain - prompt appropriately - Set MXPConnection to check the proxy state when attempting to reconnect a dropped connection, extending the timer when an auth UI is up. This prevents a multiple-dialogs misbehaviour (or sometimes deadlock), addressing the last part of http://log.sequelpro.com/view/86 . --- Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Frameworks/MCPKit') diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index 7571cd0e..555f87dc 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -476,7 +476,7 @@ static BOOL sTruncateLongFieldInLogs = YES; eventLoopStartDate = [NSDate date]; [[NSRunLoop currentRunLoop] runMode:NSModalPanelRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.25]]; if ([[NSDate date] timeIntervalSinceDate:eventLoopStartDate] < 0.25) { - usleep(250000 - (100000 * [[NSDate date] timeIntervalSinceDate:eventLoopStartDate])); + usleep(250000 - (1000000 * [[NSDate date] timeIntervalSinceDate:eventLoopStartDate])); } } @@ -505,7 +505,10 @@ static BOOL sTruncateLongFieldInLogs = YES; if ([[NSDate date] timeIntervalSinceDate:interfaceInteractionTimer] > 0.25) { proxyStartDate = [proxyStartDate addTimeInterval:([[NSDate date] timeIntervalSinceDate:interfaceInteractionTimer] - 0.25)]; } else { - usleep(250000 - (100000 * [[NSDate date] timeIntervalSinceDate:interfaceInteractionTimer])); + usleep(250000 - (1000000 * [[NSDate date] timeIntervalSinceDate:interfaceInteractionTimer])); + if ([connectionProxy state] == PROXY_STATE_WAITING_FOR_AUTH) { + proxyStartDate = [proxyStartDate addTimeInterval:0.26]; + } } } -- cgit v1.2.3