aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
diff options
context:
space:
mode:
Diffstat (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m')
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m13
1 files changed, 13 insertions, 0 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
index 143152d2..56073806 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
@@ -118,6 +118,7 @@ static BOOL sTruncateLongFieldInLogs = YES;
serverVersionString = nil;
mTimeZone = nil;
isDisconnecting = NO;
+ userTriggeredDisconnect = NO;
automaticReconnectAttempts = 0;
pingFailureCount = 0;
@@ -395,6 +396,7 @@ static BOOL sTruncateLongFieldInLogs = YES;
}
mConnected = YES;
+ userTriggeredDisconnect = NO;
connectionStartTime = mach_absolute_time();
lastKeepAliveTime = 0;
automaticReconnectAttempts = 0;
@@ -598,6 +600,7 @@ static BOOL sTruncateLongFieldInLogs = YES;
switch (failureDecision) {
case MCPConnectionCheckDisconnect:
[self setLastErrorMessage:NSLocalizedString(@"User triggered disconnection", @"User triggered disconnection")];
+ userTriggeredDisconnect = YES;
[reconnectionPool release];
return NO;
default:
@@ -619,6 +622,15 @@ static BOOL sTruncateLongFieldInLogs = YES;
}
/**
+ * Returns YES if the user chose to disconnect at the last "connection failure"
+ * prompt, NO otherwise.
+ */
+- (BOOL)userTriggeredDisconnect
+{
+ return userTriggeredDisconnect;
+}
+
+/**
* Checks if the connection to the server is still on.
* If not, tries to reconnect (changing no parameters from the MYSQL pointer).
* This method just uses mysql_ping().
@@ -670,6 +682,7 @@ static BOOL sTruncateLongFieldInLogs = YES;
case MCPConnectionCheckDisconnect:
if (mConnected) [self disconnect];
[self setLastErrorMessage:NSLocalizedString(@"User triggered disconnection", @"User triggered disconnection")];
+ userTriggeredDisconnect = YES;
return NO;
// 'Retry' has been selected - return a recursive call.