aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks
diff options
context:
space:
mode:
Diffstat (limited to 'Frameworks')
-rw-r--r--Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m5
-rw-r--r--Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m5
2 files changed, 6 insertions, 4 deletions
diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m
index e5a48d48..d96ebe52 100644
--- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m
+++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Querying & Preparation.m
@@ -296,7 +296,7 @@
[self _lockConnection];
unsigned long long theAffectedRowCount;
- while (queryAttemptsAllowed > 0) {
+ do {
// While recording the overall execution time (including network lag!), run
// the raw query
@@ -342,8 +342,7 @@
[self _lockConnection];
NSAssert(mySQLConnection != NULL, @"mySQLConnection has disappeared while checking it!");
- queryAttemptsAllowed--;
- }
+ } while (--queryAttemptsAllowed > 0);
id theResult = nil;
diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m
index e102c24d..286296af 100644
--- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m
+++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m
@@ -928,7 +928,10 @@ static uint64_t _elapsedMicroSecondsSinceAbsoluteTime(uint64_t comparisonTime)
uint64_t disconnectStartTime_t = mach_absolute_time();
while (![self _tryLockConnection]) {
usleep(100000);
- if (_elapsedSecondsSinceAbsoluteTime(disconnectStartTime_t) > 10) break;
+ if (_elapsedSecondsSinceAbsoluteTime(disconnectStartTime_t) > 10) {
+ NSLog(@"%s: Could not acquire connection lock within time limit (10s). Forcing unlock!",__PRETTY_FUNCTION__);
+ break;
+ }
}
[self _unlockConnection];
[self _cancelKeepAlives];