fix a var name

This commit is contained in:
Nikos Kouremenos 2005-07-24 19:56:47 +00:00
parent 2bf0f3e625
commit 287902c9ec
2 changed files with 7 additions and 5 deletions

View File

@ -145,7 +145,7 @@ class Config:
# send keepalive every 60 seconds of inactivity # send keepalive every 60 seconds of inactivity
'keep_alive_every_foo_secs': [ opt_int, 60 ], 'keep_alive_every_foo_secs': [ opt_int, 60 ],
# disconnect if 2 minutes have passed and server didn't reply # disconnect if 2 minutes have passed and server didn't reply
'keep_alive_disconnect_secs': [ opt_int, 120 ], 'keep_alive_disconnect_after_foo_secs': [ opt_int, 120 ],
# try for 2 minutes before giving up (aka. timeout after those seconds) # try for 2 minutes before giving up (aka. timeout after those seconds)
'try_connecting_for_foo_secs': [ opt_int, 120 ], 'try_connecting_for_foo_secs': [ opt_int, 120 ],
'max_stanza_per_sec': [ opt_int, 5], 'max_stanza_per_sec': [ opt_int, 5],

View File

@ -1348,12 +1348,14 @@ class Connection:
self.send_keepalive() self.send_keepalive()
# did the server reply to the keepalive? if no disconnect # did the server reply to the keepalive? if no disconnect
keep_alive_disconnect_secs = gajim.config.get_per('accounts', keep_alive_disconnect_after_foo_secs = gajim.config.get_per(
self.name, 'keep_alive_disconnect_secs') # 2 mins by default 'accounts', self.name,
'keep_alive_disconnect_after_foo_secs') # 2 mins by default
if time.time() > (self.last_incoming + \ if time.time() > (self.last_incoming + \
keep_alive_disconnect_secs): keep_alive_disconnect_after_foo_secs):
self.connection.disconnect() # disconnect if no answer self.connection.disconnect() # disconnect if no answer
msg = '%s seconds have passed and server did not reply to our keepalive. Gajim disconnected from %s' % (str(keep_alive_disconnect_secs), self.name) msg = '%s seconds have passed and server did not reply to our keepalive. Gajim disconnected from %s'\
% (str(keep_alive_disconnect_after_foo_secs), self.name)
gajim.log.debug(msg) gajim.log.debug(msg)
return return
if self.connection: if self.connection: