dovecot-2.1: lib-sql: If MySQL connect fails, update ioloop time...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Sep 16 16:59:32 EEST 2011
details: http://hg.dovecot.org/dovecot-2.1/rev/c056bd23fdcc
changeset: 13490:c056bd23fdcc
user: Timo Sirainen <tss at iki.fi>
date: Thu Sep 15 13:41:03 2011 +0300
description:
lib-sql: If MySQL connect fails, update ioloop times so later timeouts get added properly.
diffstat:
src/lib-sql/driver-mysql.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diffs (23 lines):
diff -r 3334c12a2b1a -r c056bd23fdcc src/lib-sql/driver-mysql.c
--- a/src/lib-sql/driver-mysql.c Thu Sep 15 13:38:54 2011 +0300
+++ b/src/lib-sql/driver-mysql.c Thu Sep 15 13:41:03 2011 +0300
@@ -1,6 +1,7 @@
/* Copyright (c) 2003-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
+#include "ioloop.h"
#include "array.h"
#include "str.h"
#include "sql-api-private.h"
@@ -109,6 +110,11 @@
client_flags) == NULL;
alarm(0);
if (failed) {
+ /* connecting could have taken a while. make sure that any
+ timeouts that get added soon will get a refreshed
+ timestamp. */
+ io_loop_time_refresh();
+
sql_db_set_state(&db->api, SQL_DB_STATE_DISCONNECTED);
i_error("%s: Connect failed to database (%s): %s - "
"waiting for %u seconds before retry",
More information about the dovecot-cvs
mailing list