dovecot: Don't try to reconnect more often than once/sec.

dovecot at dovecot.org dovecot at dovecot.org
Fri Dec 21 17:57:08 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/6950bb5e7921
changeset: 7008:6950bb5e7921
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Dec 21 17:57:04 2007 +0200
description:
Don't try to reconnect more often than once/sec.

diffstat:

1 file changed, 7 insertions(+)
src/lib-dict/dict-client.c |    7 +++++++

diffs (24 lines):

diff -r 6285b390311a -r 6950bb5e7921 src/lib-dict/dict-client.c
--- a/src/lib-dict/dict-client.c	Fri Dec 21 17:55:47 2007 +0200
+++ b/src/lib-dict/dict-client.c	Fri Dec 21 17:57:04 2007 +0200
@@ -21,6 +21,7 @@ struct client_dict {
 	const char *path;
 	enum dict_data_type value_type;
 
+	time_t last_connect_try;
 	struct istream *input;
 	struct ostream *output;
 
@@ -241,6 +242,12 @@ static int client_dict_connect(struct cl
 
 	i_assert(dict->fd == -1);
 
+	if (dict->last_connect_try == ioloop_time) {
+		/* Try again later */
+		return -1;
+	}
+	dict->last_connect_try = ioloop_time;
+
 	dict->fd = net_connect_unix(dict->path);
 	if (dict->fd == -1) {
 		i_error("net_connect_unix(%s) failed: %m", dict->path);


More information about the dovecot-cvs mailing list