Created
November 8, 2014 03:30
-
-
Save KyleSanderson/8f53e32fa4d7c36d99e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/extensions/mysql/mysql/MyDriver.cpp b/extensions/mysql/mysql/MyDriver.cpp | |
index c694182..8bcbd16 100644 | |
--- a/extensions/mysql/mysql/MyDriver.cpp | |
+++ b/extensions/mysql/mysql/MyDriver.cpp | |
@@ -96,16 +96,16 @@ MYSQL *Connect(const DatabaseInfo *info, char *error, size_t maxlength) | |
MYSQL *mysql = mysql_init(NULL); | |
const char *host = NULL, *socket = NULL; | |
- if (info->maxTimeout > 0) | |
- { | |
- mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&(info->maxTimeout)); | |
- } | |
+ const unsigned int five = 5; | |
+ mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&five); | |
/* Have MySQL automatically reconnect if it times out or loses connection. | |
* This will prevent "MySQL server has gone away" errors after a while. | |
*/ | |
my_bool my_true = true; | |
mysql_options(mysql, MYSQL_OPT_RECONNECT, (const char *)&my_true); | |
+ mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (const char *)&five); | |
+ mysql_options(mysql, MYSQL_OPT_WRITE_TIMEOUT, (const char *)&five); | |
if (info->host[0] == '/') | |
{ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment