X-Git-Url: https://code.delx.au/pymsnt/blobdiff_plain/50c48f46fada2ff7f305d3f0eead0d49727cbf54..f3c0541ec9baf3be95cd24b54f2844f1e1b51d93:/src/tlib/msn/msnw.py diff --git a/src/tlib/msn/msnw.py b/src/tlib/msn/msnw.py index 368bdfe..46d8018 100644 --- a/src/tlib/msn/msnw.py +++ b/src/tlib/msn/msnw.py @@ -51,6 +51,7 @@ class MSNConnection: def _getNotificationReferral(self): def timeout(): self.timeout = None + dispatchFactory.d = None if not d.called: d.errback(Exception("Timeout")) self.logOut() # Clean up everything @@ -358,8 +359,11 @@ class SavedEvents: 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):