Author: wyoung
Date: Thu Jun 21 19:03:36 2007
New Revision: 1578

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1578&view=rev
Log:
Options hard-coded in Connection::connect() now get set in such a way
that caller can override them.  Previously, you couldn't change these
hard-coded values even if you wanted to.

Modified:
    trunk/lib/connection.cpp

Modified: trunk/lib/connection.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.cpp?rev=1578&r1=1577&r2=1578&view=diff
==============================================================================
--- trunk/lib/connection.cpp (original)
+++ trunk/lib/connection.cpp Thu Jun 21 19:03:36 2007
@@ -172,15 +172,18 @@
                disconnect();
        }
 
-       // Set pre-connection options
+       // Set defaults for some options.  We put these at the front of the
+       // queue so that if user sets these, too, that will override these
+       // values.
+       pending_options_.push_front(OptionInfo(opt_read_default_file, "my"));
+       pending_options_.push_front(OptionInfo(opt_connect_timeout,
+                       connect_timeout));
+       if (compress) {
+               pending_options_.push_front(OptionInfo(opt_compress));
+       }
+
+       // Establish connection
        scoped_var_set<bool> sb(connecting_, true);
-       set_option(opt_read_default_file, "my");
-       set_option(opt_connect_timeout, connect_timeout);
-       if (compress) {
-               set_option(opt_compress);
-       }
-
-       // Establish connection
        if (apply_pending_options() &&
                        mysql_real_connect(&mysql_, host, user, passwd, db, 
port,
                        socket_name, client_flag)) {


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to