def _getNotificationReferral(self):
def timeout():
self.timeout = None
+ dispatchFactory.d = None
if not d.called:
d.errback(Exception("Timeout"))
self.logOut() # Clean up everything
class DispatchClient(msn.DispatchClient):
def gotNotificationReferral(self, host, port):
- if self.factory.d.called: return # Too slow! We've already timed out
- self.factory.d.callback((host, port))
+ d = self.factory.d
+ self.factory.d = None
+ if not d or d.called:
+ return # Too slow! We've already timed out
+ d.callback((host, port))
class NotificationClient(msn.NotificationClient):