glom r1933 - in trunk: . glom/libglom/connectionpool_backends



Author: arminb
Date: Tue Feb 24 14:01:57 2009
New Revision: 1933
URL: http://svn.gnome.org/viewvc/glom?rev=1933&view=rev

Log:
2009-02-24  Armin Burgmeier  <armin openismus com>

	* glom/libglom/connectionpool_backends/postgres_central.cc (set_host):
	Only reset m_port to zero if m_try_other_ports is true. Otherwise, a
	specific port has already been set by the user.
	(connect): Compare m_port to 0, not port, which is a Glib::ustring.
	This fixes a warning about g_utf8_collate's argument being NULL, and
	fixes connection to a remote postgres server advertized via networked
	glom.


Modified:
   trunk/ChangeLog
   trunk/glom/libglom/connectionpool_backends/postgres_central.cc

Modified: trunk/glom/libglom/connectionpool_backends/postgres_central.cc
==============================================================================
--- trunk/glom/libglom/connectionpool_backends/postgres_central.cc	(original)
+++ trunk/glom/libglom/connectionpool_backends/postgres_central.cc	Tue Feb 24 14:01:57 2009
@@ -68,7 +68,10 @@
   if(value != m_host)
   {
     m_host = value;
-    m_port = 0; // Force us to try all ports again when connecting for the first time, then remember the working port again.
+
+    // Force us to try all ports again when connecting for the first time, then remember the working port again. Except when a specific port was set to be used.
+    if(m_try_other_ports)
+      m_port = 0;
   }
 }
 
@@ -106,7 +109,7 @@
 
   //Start with the remembered-as-working port:
   Glib::ustring port = port_as_string(m_port);
-  if(port == 0)
+  if(m_port == 0)
     port = *iter_port ++;
 
   connection = attempt_connect(m_host, port, database, username, password, error);



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