From 273bd3720a857e4b886aa81b561854c250ea20e7 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 2 Nov 2017 21:21:22 +0100 Subject: Swap two lines of code so that if a connection attempt is cancelled, SP does not try to open another connection to cancel the pending connection (#2909) --- Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Frameworks/SPMySQLFramework') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m index f581c03c..d50375e2 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m @@ -1007,11 +1007,11 @@ static uint64_t _elapsedMicroSecondsSinceAbsoluteTime(uint64_t comparisonTime) return; } - state = SPMySQLDisconnecting; - // If a query is active, cancel it [self cancelCurrentQuery]; + state = SPMySQLDisconnecting; + // Allow any pings or cancelled queries to complete, inside a time limit of ten seconds uint64_t disconnectStartTime_t = mach_absolute_time(); while (![self _tryLockConnection]) { -- cgit v1.2.3