From 80c2f297d6d9c27971103ff0c2c5231df9ac28a9 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 9 Oct 2006 15:53:30 +0000 Subject: [PATCH] reconnect time is now random ([5-15] if retrycount <= 5, else [15, 25]) reconnect infinitly when autoreconnect option is True. fixes #2411 --- src/common/connection.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 2d0feea4d..095cf2d4f 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -133,15 +133,14 @@ class Connection(ConnectionHandlers): self.dispatch('STATUS', 'offline') if not self.on_purpose: self.disconnect() - if gajim.config.get_per('accounts', self.name, 'autoreconnect') \ - and self.retrycount <= 10: + if gajim.config.get_per('accounts', self.name, 'autoreconnect'): self.connected = 1 self.dispatch('STATUS', 'connecting') # this check has moved from _reconnect method if self.retrycount > 5: - self.time_to_reconnect = 20 + self.time_to_reconnect = random.randint(15, 25) else: - self.time_to_reconnect = 10 + self.time_to_reconnect = random.randint(5, 15) gajim.idlequeue.set_alarm(self._reconnect_alarm, self.time_to_reconnect) elif self.on_connect_failure: @@ -365,7 +364,7 @@ class Connection(ConnectionHandlers): secure = self._secure) return else: - if not retry or self.retrycount > 10: + if not retry: self.retrycount = 0 self.time_to_reconnect = None if self.on_connect_failure: