aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMMCPConnection.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-06-21 22:32:06 +0000
committerrowanbeentje <rowan@beent.je>2009-06-21 22:32:06 +0000
commit859ca6771c479475ed454a4dbc61131fad30b492 (patch)
tree72af0608e7c9505a2f5fc5e3fa57c326c5691791 /Source/CMMCPConnection.m
parente0b11c990a8c561e49b2148ea7208785ad6d0bd1 (diff)
downloadsequelpro-859ca6771c479475ed454a4dbc61131fad30b492.tar.gz
sequelpro-859ca6771c479475ed454a4dbc61131fad30b492.tar.bz2
sequelpro-859ca6771c479475ed454a4dbc61131fad30b492.zip
- Allow connections via SSH tunnels to reattempt using the specified host if 127.0.0.1 was retried automatically.
- Store the SSH debug logs and allow viewing on connection error - Clean up CMMCPConnections on connection failure - Fix connection keepalive instantiation
Diffstat (limited to 'Source/CMMCPConnection.m')
-rw-r--r--Source/CMMCPConnection.m23
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/CMMCPConnection.m b/Source/CMMCPConnection.m
index 60b8d2da..e31b9765 100644
--- a/Source/CMMCPConnection.m
+++ b/Source/CMMCPConnection.m
@@ -182,6 +182,15 @@ static void forcePingTimeout(int signalNumber);
return YES;
}
+/*
+ * Sets or updates the connection port - for use with tunnels.
+ */
+- (BOOL) setPort:(int) thePort
+{
+ connectionPort = thePort;
+
+ return YES;
+}
/*
* Set a SSH tunnel object to connect through. This object will be retained locally,
@@ -215,9 +224,6 @@ static void forcePingTimeout(int signalNumber);
// Ensure that a password method has been provided
if (connectionKeychainName == nil && connectionPassword == nil) return NO;
- // Start the keepalive timer
- [self startKeepAliveTimerResettingState:YES];
-
// Disconnect if a connection is already active
if (mConnected) {
[self disconnect];
@@ -259,10 +265,6 @@ static void forcePingTimeout(int signalNumber);
thePass = NULL;
if (theRet != mConnection) {
[self setLastErrorMessage:nil];
- if (connectionTunnel) {
- [connectionTunnel disconnect];
- [delegate setStatusIconToImageWithName:@"ssh-disconnected"];
- }
return mConnected = NO;
}
@@ -275,10 +277,6 @@ static void forcePingTimeout(int signalNumber);
if (![self fetchMaxAllowedPacket]) {
[self setLastErrorMessage:nil];
- if (connectionTunnel) {
- [connectionTunnel disconnect];
- [delegate setStatusIconToImageWithName:@"ssh-disconnected"];
- }
return mConnected = NO;
}
@@ -291,6 +289,9 @@ static void forcePingTimeout(int signalNumber);
// Init 'consoleLoggingEnabled'
consoleLoggingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"ConsoleEnableLogging"];
+
+ // Start the keepalive timer
+ [self startKeepAliveTimerResettingState:YES];
return mConnected;
}