fix a var name
This commit is contained in:
		
							parent
							
								
									2bf0f3e625
								
							
						
					
					
						commit
						287902c9ec
					
				
					 2 changed files with 7 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -145,7 +145,7 @@ class Config:
 | 
			
		|||
			# send keepalive every 60 seconds of inactivity
 | 
			
		||||
			'keep_alive_every_foo_secs': [ opt_int, 60 ],
 | 
			
		||||
			# 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_connecting_for_foo_secs': [ opt_int, 120 ],
 | 
			
		||||
			'max_stanza_per_sec': [ opt_int, 5],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1348,12 +1348,14 @@ class Connection:
 | 
			
		|||
						self.send_keepalive()
 | 
			
		||||
 | 
			
		||||
					# did the server reply to the keepalive? if no disconnect
 | 
			
		||||
					keep_alive_disconnect_secs = gajim.config.get_per('accounts',
 | 
			
		||||
						self.name, 'keep_alive_disconnect_secs') # 2 mins by default
 | 
			
		||||
					keep_alive_disconnect_after_foo_secs = gajim.config.get_per(
 | 
			
		||||
						'accounts', self.name,
 | 
			
		||||
						'keep_alive_disconnect_after_foo_secs') # 2 mins by default
 | 
			
		||||
					if time.time() > (self.last_incoming + \
 | 
			
		||||
							keep_alive_disconnect_secs):
 | 
			
		||||
							keep_alive_disconnect_after_foo_secs):
 | 
			
		||||
						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)
 | 
			
		||||
						return
 | 
			
		||||
				if self.connection:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue