1.5-1 release
[manu/libnss-mysql-bg.git] / src / mysql.c
index 179bd25..08736b3 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 static const char rcsid[] =
  */
 
 static const char rcsid[] =
-    "$Id: mysql.c,v 1.44 2004/11/13 16:25:26 cinergi Exp $";
+    "$Id: mysql.c,v 1.46 2005/09/04 03:34:02 cinergi Exp $";
 
 #include "nss_mysql.h"
 #include <string.h>     /* strlen() */
 
 #include "nss_mysql.h"
 #include <string.h>     /* strlen() */
@@ -137,27 +137,14 @@ static void
 _nss_mysql_set_options (sql_server_t *server)
 {
   DN ("_nss_mysql_set_options")
 _nss_mysql_set_options (sql_server_t *server)
 {
   DN ("_nss_mysql_set_options")
-  unsigned int timeout;
+  const unsigned int def_timeout = DEF_TIMEOUT;
 
   DENTER
 
   DENTER
-  if (server->options.timeout)
-    timeout = (unsigned int) atoi (server->options.timeout);
-  else
-    timeout = DEF_TIMEOUT;
-  D ("%s: Setting connect timeout to %d", FUNCNAME, timeout);
+
   mysql_options(&ci.link, MYSQL_OPT_CONNECT_TIMEOUT,
   mysql_options(&ci.link, MYSQL_OPT_CONNECT_TIMEOUT,
-                (char *)&timeout);
-  if (server->options.compress && atoi (server->options.compress))
-    {
-      D ("%s: Setting compressed protocol", FUNCNAME);
-      mysql_options(&ci.link, MYSQL_OPT_COMPRESS, 0);
-    }
-  if (server->options.initcmd && strlen (server->options.initcmd))
-    {
-      D ("%s: Setting init-command to '%s'", FUNCNAME, server->options.initcmd);
-      mysql_options(&ci.link, MYSQL_INIT_COMMAND,
-                    (char *)server->options.initcmd);
-    }
+                (const char *) &def_timeout);
+  mysql_options(&ci.link, MYSQL_READ_DEFAULT_GROUP, "libnss-mysql");
+
   DEXIT
 }
 
   DEXIT
 }