- In verbose mode, print encodings. (Especially for Windows users who don't have Python) (gajim.py)
 - Attempt at fixing traceback when getting user's home directory in Windows. See #2812. (c/configpaths.py)
 - Show 'error' icon next to account while waiting for reconnect. Fixes #2786. (c/connection_handlers.py, c/gajim.py, c/connection.py)
[PyOpenSSL]
 - Fix 100% CPU usage and hanging connection when server closes connection on us. (c/x/transports_nb.py)
 - Fix 'hanging' connection when server closes the connection on us before we can open the XML stream. (Disconnect handler didn't get called.) (c/x/client_nb.py)
 - Change prints to logger calls, various enhancements to debug printing, reduce spam (c/x/transports_nb.py)
 - this → self (c/x/transports_nb.py)
 - Call _do_receive() once to collect error message from socket, when error flag is raised in scheduler. (c/x/transports_nb.py)
This commit is contained in:
junglecow 2006-12-20 20:40:08 +00:00
parent 4fe582151a
commit a4655276fe
6 changed files with 21 additions and 7 deletions

View File

@ -369,4 +369,10 @@
<item jid="xmpp.us" name="">
<active port="5222"/>
</item>
</query>
<item jid="zloygod.serveftp.com" name="Rituko's server">
<active port="5222"/>
</item>
<item jid="localhost" name="Localhost">
<active port="5222"/>
</item>
</query>

View File

@ -87,7 +87,7 @@ def init():
paths.add_from_root(n, p)
paths.add('DATA', os.path.join(u'..', windowsify(u'data')))
paths.add('HOME', os.path.expanduser(u'~'))
paths.add('HOME', fse(os.path.expanduser('~')))
paths.add('TMP', fse(tempfile.gettempdir()))
try:

View File

@ -109,6 +109,8 @@ class Connection(ConnectionHandlers):
self.time_to_reconnect = None
if self.connected < 2: #connection failed
gajim.log.debug('reconnect')
self.connected = 1
self.dispatch('STATUS', 'connecting')
self.retrycount += 1
signed = self.get_signed_msg(self.status)
self.on_connect_auth = self._init_roster
@ -143,8 +145,8 @@ class Connection(ConnectionHandlers):
if not self.on_purpose:
self.disconnect()
if gajim.config.get_per('accounts', self.name, 'autoreconnect'):
self.connected = 1
self.dispatch('STATUS', 'connecting')
self.connected = -1
self.dispatch('STATUS', 'error')
# this check has moved from _reconnect method
# do exponential backoff until 15 minutes,
# then small linear increase
@ -154,7 +156,7 @@ class Connection(ConnectionHandlers):
self.last_time_to_reconnect *= 1.5
self.last_time_to_reconnect += randomsource.randint(0, 5)
self.time_to_reconnect = int(self.last_time_to_reconnect)
gajim.log.debug("Reconnect to %s in %ss", self.name, self.time_to_reconnect)
gajim.log.info("Reconnect to %s in %ss", self.name, self.time_to_reconnect)
gajim.idlequeue.set_alarm(self._reconnect_alarm,
self.time_to_reconnect)
elif self.on_connect_failure:
@ -379,11 +381,13 @@ class Connection(ConnectionHandlers):
if self.on_connect_success == self._on_new_account:
con.RegisterDisconnectHandler(self._on_new_account)
gajim.log.info("Connecting to %s: [%s:%d]", self.name, host['host'], host['port'])
con.connect((host['host'], host['port']), proxy = self._proxy,
secure = self._secure)
return
else:
if not retry and self.retrycount == 0:
gajim.log.error("Out of hosts, giving up connecting to %s", self.name)
self.time_to_reconnect = None
if self.on_connect_failure:
self.on_connect_failure()

View File

@ -38,7 +38,7 @@ from common.commands import ConnectionCommands
from common.pubsub import ConnectionPubSub
STATUS_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
'invisible']
'invisible', 'error']
# kind of events we can wait for an answer
VCARD_PUBLISHED = 'vcard_published'
VCARD_ARRIVED = 'vcard_arrived'

View File

@ -121,7 +121,7 @@ sleeper_state = {} # whether we pass auto away / xa or not
status_before_autoaway = {}
SHOW_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
'invisible']
'invisible', 'error']
# zeroconf account name
ZEROCONF_ACC_NAME = 'Local'

View File

@ -2157,6 +2157,10 @@ if __name__ == '__main__':
# ^C exits the application normally to delete pid file
signal.signal(signal.SIGINT, sigint_cb)
if gajim.verbose:
print >> sys.stderr, "Encodings: d:%s, fs:%s, p:%s" % \
(sys.getdefaultencoding(), sys.getfilesystemencoding(), locale.getpreferredencoding())
if os.name != 'nt':
# Session Management support
try: