dovecot-2.0: pgsql: Don't assert-crash if query fails when tryin...

dovecot at dovecot.org dovecot at dovecot.org
Fri Mar 4 19:51:51 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/f95b1e26f1f2
changeset: 12647:f95b1e26f1f2
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Mar 04 19:51:06 2011 +0200
description:
pgsql: Don't assert-crash if query fails when trying to send it.

diffstat:

 src/lib-sql/driver-pgsql.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r 27ee65dc87c2 -r f95b1e26f1f2 src/lib-sql/driver-pgsql.c
--- a/src/lib-sql/driver-pgsql.c	Fri Mar 04 19:33:52 2011 +0200
+++ b/src/lib-sql/driver-pgsql.c	Fri Mar 04 19:51:06 2011 +0200
@@ -450,6 +450,7 @@
 	i_assert(db->cur_result == NULL);
 	i_assert(db->io == NULL);
 
+	driver_pgsql_set_state(db, SQL_DB_STATE_BUSY);
 	db->cur_result = result;
 	result->to = timeout_add(SQL_QUERY_TIMEOUT_SECS * 1000,
 				 query_timeout, result);
@@ -461,7 +462,6 @@
 		return;
 	}
 
-	driver_pgsql_set_state(db, SQL_DB_STATE_BUSY);
 	if (ret > 0) {
 		/* write blocks */
 		db->io = io_add(PQsocket(db->pg), IO_WRITE,


More information about the dovecot-cvs mailing list