From 478e10757b2a53c7dc52dd3a7b21dd4d7b5e84a9 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 8 Aug 2011 00:16:37 +0000 Subject: - Improve interactive_timeout handling, ensuring a minimum timeout of five minutes to improve keepalive behaviour. This improves on r3369 and should complete Issue #877. - Fix memory leak added in r3382 --- Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index 47d45c8f..0e96ce5d 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -3338,6 +3338,15 @@ void pingThreadCleanup(void *pingDetails) encoding = [[NSString alloc] initWithString:serverEncoding]; stringEncoding = [MCPConnection encodingForMySQLEncoding:[self cStringFromString:encoding]]; encodingUsesLatin1Transport = NO; + + // Check the interactive timeout - if it's below five minutes, increase it to ten to imprive timeout/keepalive behaviour + if ([variables objectForKey:@"interactive_timeout"]) { + if ([[variables objectForKey:@"interactive_timeout"] integerValue] < 300) { + [self queryString:@"SET interactive_timeout=600"]; + } + } + + [variables release]; } /** -- cgit v1.2.3