[Dovecot] A questions about consume_results (driver-pgsql.c)

Rainer Weikusat rweikusat at mssgmbh.com
Thu Mar 25 21:04:23 EET 2010


Code
--------------
static void consume_results(struct pgsql_db *db)
{
	do {
		if (!PQconsumeInput(db->pg))
			break;

		if (PQisBusy(db->pg))
			return;
	} while (PQgetResult(db->pg) != NULL);

	if (PQstatus(db->pg) == CONNECTION_BAD)
		io_remove_closed(&db->io);
	else
		io_remove(&db->io);

	db->querying = FALSE;
	if (db->queue != NULL && db->connected)
		queue_send_next(db);
}
---------------

This is the only part of the driver-pgsql.c code where a
CONNECTION_BAD does not result in driver_pgsql_close being called.
This will likely happen after the next query (from queue or a new one)
failed because the connection was bad. Is there a reason for this?


More information about the dovecot mailing list