fix link-local problems when reconnecting vie network-manager

This commit is contained in:
Stefan Bethge 2007-11-19 03:29:10 +00:00
parent 2369c01cc1
commit 1f818a04e9
2 changed files with 9 additions and 4 deletions

View File

@ -141,7 +141,8 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
gajim.log.debug('reconnect')
# signed = self.get_signed_msg(self.status)
self.connect(self.old_show, self.status)
self.disconnect()
self.change_status(self.old_show, self.status)
def quit(self, kill_core):
if kill_core and self.connected > 1:

View File

@ -184,9 +184,12 @@ class Zeroconf:
self.disconnect()
def server_state_changed_callback(self, state, error):
gajim.log.debug('server state changed to %s' % state)
if state == self.avahi.SERVER_RUNNING:
self.create_service()
elif state == self.avahi.SERVER_COLLISION:
elif state in (self.avahi.SERVER_COLLISION,
self.avahi.SERVER_REGISTERING):
self.disconnect()
self.entrygroup.Reset()
elif state == self.avahi.CLIENT_FAILURE:
# does it ever go here?
@ -197,6 +200,8 @@ class Zeroconf:
if state == self.avahi.ENTRY_GROUP_COLLISION:
self.service_add_fail_callback('Local name collision')
elif state == self.avahi.ENTRY_GROUP_FAILURE:
self.disconnect()
self.entrygroup.Reset()
gajim.log.debug('zeroconf.py: ENTRY_GROUP_FAILURE reached(that'
' should not happen)')
@ -278,8 +283,7 @@ class Zeroconf:
self.entrygroup.Reset()
self.entrygroup.Free()
# .Free() has mem leaks
obj = self.entrygroup._obj
obj._bus = None
self.entrygroup._obj._bus = None
self.entrygroup._obj = None
self.entrygroup = None
self.announced = False