changeset 6792:7005fc7e69dc HEAD

More fixes to handling driver_pgsql_query_s() when not connected.
author Timo Sirainen <tss@iki.fi>
date Mon, 12 Nov 2007 19:23:55 +0200
parents 4d6ba6cd1bbc
children 33cfef65a5e1
files src/lib-sql/driver-pgsql.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-sql/driver-pgsql.c	Mon Nov 12 19:16:30 2007 +0200
+++ b/src/lib-sql/driver-pgsql.c	Mon Nov 12 19:23:55 2007 +0200
@@ -574,13 +574,17 @@
 	driver_pgsql_query(_db, query, pgsql_query_s_callback, db);
 
 	if (!db->query_finished) {
-		if (db->connected)
+		if (db->connected || db->connecting)
 			io_loop_run(db->ioloop);
-		else {
-			if (db->queue_to != NULL)
-				timeout_remove(&db->queue_to);
+		else
 			queue_abort_next(db);
+
+		if (db->io != NULL) {
+			i_assert(db->sync_result == &sql_not_connected_result);
+			io_remove(&db->io);
 		}
+		if (db->queue_to != NULL)
+			timeout_remove(&db->queue_to);
 	}
 	io_loop_destroy(&db->ioloop);