Commit adeff678 authored by Olivier Bertrand's avatar Olivier Bertrand

- Set timeout values in MYSQLC::Open

modified:
  storage/connect/myconn.cpp
parent ffa2eb43
...@@ -311,6 +311,8 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db, ...@@ -311,6 +311,8 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db,
const char *user, const char *pwd, const char *user, const char *pwd,
int pt) int pt)
{ {
uint cto = 60, nrt = 120;
m_DB = mysql_init(NULL); m_DB = mysql_init(NULL);
if (!m_DB) { if (!m_DB) {
...@@ -323,6 +325,9 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db, ...@@ -323,6 +325,9 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db,
// client's options, and vice versa. // client's options, and vice versa.
mysql_options(m_DB, MYSQL_READ_DEFAULT_GROUP, "PlugDB_CLIENT"); mysql_options(m_DB, MYSQL_READ_DEFAULT_GROUP, "PlugDB_CLIENT");
mysql_options(m_DB, MYSQL_OPT_USE_REMOTE_CONNECTION, NULL); mysql_options(m_DB, MYSQL_OPT_USE_REMOTE_CONNECTION, NULL);
mysql_options(m_DB, MYSQL_OPT_CONNECT_TIMEOUT, &cto);
mysql_options(m_DB, MYSQL_OPT_READ_TIMEOUT, &nrt);
//mysql_options(m_DB, MYSQL_OPT_WRITE_TIMEOUT, ...);
#if 0 #if 0
if (pwd && !strcmp(pwd, "*")) { if (pwd && !strcmp(pwd, "*")) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment