You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by ni...@apache.org on 2009/11/20 18:35:30 UTC

svn commit: r882650 - in /apr/apr/trunk: CHANGES dbd/apr_dbd_mysql.c

Author: niq
Date: Fri Nov 20 17:35:23 2009
New Revision: 882650

URL: http://svn.apache.org/viewvc?rev=882650&view=rev
Log:
Support connecttimeout, readtimeout and writetimeout MySQL options
PR 48251
Submitted by Marko Kevac


Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/dbd/apr_dbd_mysql.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=882650&r1=882649&r2=882650&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Fri Nov 20 17:35:23 2009
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 2.0.0
 
+  *) Support connecttimeout, readtimeout and writetimeout MySQL options
+     PR 48251 [Marko Kevac <marko kevac.org>]
+
   *) Add apr_socket_atreadeof to determine whether the receive part of the
      socket has been closed by the peer.
      [Ruediger Pluem, Mladen Turk, Joe Orton]

Modified: apr/apr/trunk/dbd/apr_dbd_mysql.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/dbd/apr_dbd_mysql.c?rev=882650&r1=882649&r2=882650&view=diff
==============================================================================
--- apr/apr/trunk/dbd/apr_dbd_mysql.c (original)
+++ apr/apr/trunk/dbd/apr_dbd_mysql.c Fri Nov 20 17:35:23 2009
@@ -1122,7 +1122,12 @@
         {"flags", NULL},
         {"fldsz", NULL},
         {"group", NULL},
+#if MYSQL_VERSION_ID >= 50013
         {"reconnect", NULL},
+        {"connecttimeout", NULL},
+        {"readtimeout", NULL},
+        {"writetimeout", NULL},
+#endif
         {NULL, NULL}
     };
     unsigned int port = 0;
@@ -1178,6 +1183,18 @@
     if (fields[9].value != NULL) {
          do_reconnect = atoi(fields[9].value) ? 1 : 0;
     }
+    if (fields[10].value != NULL) {
+         mysql_options(sql->conn, MYSQL_OPT_CONNECT_TIMEOUT,
+                       atoi(fields[10].value));
+    }
+    if (fields[11].value != NULL) {
+         mysql_options(sql->conn, MYSQL_OPT_READ_TIMEOUT,
+                       atoi(fields[11].value));
+    }
+    if (fields[12].value != NULL) {
+         mysql_options(sql->conn, MYSQL_OPT_WRITE_TIMEOUT,
+                       atoi(fields[12].value));
+    }
 #endif
 
 #if MYSQL_VERSION_ID >= 50013