gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r5169 - GNUnet/src/applications/sqstore_mysql


From: gnunet
Subject: [GNUnet-SVN] r5169 - GNUnet/src/applications/sqstore_mysql
Date: Thu, 28 Jun 2007 23:39:19 -0600 (MDT)

Author: grothoff
Date: 2007-06-28 23:39:19 -0600 (Thu, 28 Jun 2007)
New Revision: 5169

Modified:
   GNUnet/src/applications/sqstore_mysql/mysql.c
Log:
set timeout

Modified: GNUnet/src/applications/sqstore_mysql/mysql.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysql.c       2007-06-29 01:32:38 UTC 
(rev 5168)
+++ GNUnet/src/applications/sqstore_mysql/mysql.c       2007-06-29 05:39:19 UTC 
(rev 5169)
@@ -297,6 +297,8 @@
 static int iopen(mysqlHandle * dbhI,
                 int prepare) {
   char * dbname;
+  my_bool reconnect = 0;
+  unsigned int timeout = 5; /* in seconds */
 
   if (dbhI->cnffile == NULL)
     return SYSERR;
@@ -309,6 +311,19 @@
   mysql_options(dbhI->dbf,
                MYSQL_READ_DEFAULT_GROUP,
                "client");
+  mysql_options(dbhI->dbf,
+               MYSQL_OPT_RECONNECT, 
+               &reconnect);
+  mysql_options(dbhI->dbf,
+               MYSQL_OPT_CONNECT_TIMEOUT,
+               (const void*) &timeout);
+  mysql_options(dbhI->dbf,
+               MYSQL_OPT_READ_TIMEOUT,
+               (const void*) &timeout);
+  mysql_options(dbhI->dbf,
+               MYSQL_OPT_WRITE_TIMEOUT,
+               (const void*) &timeout);
+
   dbname = NULL;
   GC_get_configuration_value_string(coreAPI->cfg,
                                    "MYSQL",
@@ -1434,7 +1449,7 @@
   unsigned long long * sb;
   MYSQL_RES *sql_res;
   MYSQL_ROW sql_row;
-
+  
   ectx = capi->ectx;
   coreAPI = capi;
   stats = coreAPI->requestService("stats");





reply via email to

[Prev in Thread] Current Thread [Next in Thread]