changeset 7008:6950bb5e7921 HEAD

Don't try to reconnect more often than once/sec.
author Timo Sirainen <tss@iki.fi>
date Fri, 21 Dec 2007 17:57:04 +0200
parents 6285b390311a
children 24233c8361fc
files src/lib-dict/dict-client.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 	const char *path;
 	enum dict_data_type value_type;
 
+	time_t last_connect_try;
 	struct istream *input;
 	struct ostream *output;
 
@@ -241,6 +242,12 @@
 
 	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);