[dovecot-cvs] dovecot/src/lib-sql driver-pgsql.c,1.19,1.20

tss at dovecot.org tss at dovecot.org
Tue Apr 3 08:11:50 EEST 2007


Update of /var/lib/cvs/dovecot/src/lib-sql
In directory talvi:/tmp/cvs-serv8272

Modified Files:
	driver-pgsql.c 
Log Message:
If trying to escape a string before being connected, connect first.



Index: driver-pgsql.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-sql/driver-pgsql.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- driver-pgsql.c	3 Apr 2007 05:10:05 -0000	1.19
+++ driver-pgsql.c	3 Apr 2007 05:11:48 -0000	1.20
@@ -452,6 +452,10 @@
 
 	to = t_buffer_get(len * 2 + 1);
 #ifdef HAVE_PQESCAPE_STRING_CONN
+	if (!db->connected) {
+		/* try connecting again */
+		(void)driver_pgsql_connect(&db->api);
+	}
 	len = PQescapeStringConn(db->pg, to, string, len, NULL);
 #else
 	len = PQescapeString(to, string, len);



More information about the dovecot-cvs mailing list