From 48ca39af327bbba4a0fc565c37d3e165758cf731 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 22 Jul 2009 09:26:11 +0000 Subject: - Allow the reconnection dialogs to function correctly if anything other than "Disconnect" is selected - Fix tunnel restarts --- Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 8 ++++---- Source/TableDocument.m | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index 3dc94b3a..55fbca84 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -292,14 +292,14 @@ static BOOL sTruncateLongFieldInLogs = YES; } // Select the password from the provided method - if (!connectionPassword) { + if (!connectionPassword) { if (delegate && [delegate respondsToSelector:@selector(keychainPasswordForConnection:)]) { thePass = [self cStringFromString:[delegate keychainPasswordForConnection:self]]; } } else { thePass = [self cStringFromString:connectionPassword]; } - + // Connect theRet = mysql_real_connect(mConnection, theHost, theLogin, thePass, NULL, connectionPort, theSocket, mConnectionFlags); thePass = NULL; @@ -417,7 +417,7 @@ static BOOL sTruncateLongFieldInLogs = YES; } currentProxyState = [connectionProxy state]; - [connectionProxy setConnectionStateChangeSelector:@selector(sshTunnelStateChange:) delegate:self]; + [connectionProxy setConnectionStateChangeSelector:@selector(connectionProxyStateChange:) delegate:self]; } if (!connectionProxy || [connectionProxy state] == PROXY_STATE_CONNECTED) { @@ -1961,7 +1961,7 @@ static void forcePingTimeout(int signalNumber) - (void) dealloc { delegate = nil; - + if (lastQueryErrorMessage) [lastQueryErrorMessage release]; if (connectionHost) [connectionHost release]; if (connectionLogin) [connectionLogin release]; diff --git a/Source/TableDocument.m b/Source/TableDocument.m index ae2457e3..8302f553 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -2067,9 +2067,11 @@ [connectionErrorDialog orderOut:nil]; // If "disconnect" was selected, trigger a window close. - [self windowWillClose:nil]; - if (connectionErrorCode == MCPConnectionCheckDisconnect) - [tableWindow performSelector:@selector(close) withObject:nil afterDelay:0.0]; + if (connectionErrorCode == 2) { + [self windowWillClose:nil]; + if (connectionErrorCode == MCPConnectionCheckDisconnect) + [tableWindow performSelector:@selector(close) withObject:nil afterDelay:0.0]; + } return connectionErrorCode; } -- cgit v1.2.3