From a9e0ce5a0e5e785611edc68bdad8865219b6e964 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 8 Feb 2008 07:47:35 +0000 Subject: [PATCH] add advanced option to configure the time we wait XMPP Ping answer --- src/common/config.py | 1 + src/common/connection.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/config.py b/src/common/config.py index 9eda27542..a8a0e6603 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -296,6 +296,7 @@ class Config: 'keep_alives_enabled': [ opt_bool, True], # send keepalive every N seconds of inactivity 'keep_alive_every_foo_secs': [ opt_int, 55 ], + 'time_for_keep_alive_answer': [ opt_int, 20, _('How many seconds to wait for the answer of keepalive packet before we try to reconnect.') ], # try for 2 minutes before giving up (aka. timeout after those seconds) 'try_connecting_for_foo_secs': [ opt_int, 60 ], 'http_auth': [opt_str, 'ask'], # yes, no, ask diff --git a/src/common/connection.py b/src/common/connection.py index 5894167b7..e1e8ac62d 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -732,7 +732,8 @@ class Connection(ConnectionHandlers): self.connection.SendAndCallForResponse(iq, _on_response) else: self.connection.send(iq) - gajim.idlequeue.set_alarm(self.check_keepalive, 5) + gajim.idlequeue.set_alarm(self.check_keepalive, gajim.config.get_per( + 'accounts', self.name, 'time_for_keep_alive_answer') def get_active_default_lists(self): if not self.connection: