From cb29bcb923804e844411fb4872f55993bf29ee91 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 8 May 2012 01:03:31 +0000 Subject: Rework connection loss handling in SPMySQL, particularly to improve background loss of connections: - Attempt to fix a condition causing a reconnection loop by fixing the order of connection state check and a query variable - If a connection is lost in the background, only attempt a single reconnect instead of requiring user intervention at once - Add a new connection state to handle background disconnects - If the connection has been lost in the background but is about to be used, reconnect it automatically (informing the user of loss if appropriate) - Don't attempt background reconnections if the connection has not been used for some time (Also update localisable strings, and tweak navigator controller connection usage) --- Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h index 8ed01ec6..a44ae46f 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.h @@ -72,7 +72,7 @@ NSConditionLock *connectionLock; // Currently selected database - NSString *database; + NSString *database, *databaseToRestore; // Delegate connection lost decisions NSUInteger reconnectionRetryAttempts; @@ -93,9 +93,9 @@ // Encoding details - and also a record of any previous encoding to allow // switching back and forth - NSString *encoding; + NSString *encoding, *encodingToRestore; NSStringEncoding stringEncoding; - BOOL encodingUsesLatin1Transport; + BOOL encodingUsesLatin1Transport, encodingUsesLatin1TransportToRestore; NSString *previousEncoding; BOOL previousEncodingUsesLatin1Transport; -- cgit v1.2.3