Skip to content

Instantly share code, notes, and snippets.

@clemesha
Created December 15, 2009 00:00
Show Gist options
  • Save clemesha/256582 to your computer and use it in GitHub Desktop.
Save clemesha/256582 to your computer and use it in GitHub Desktop.
Index: orbited/transports/base.py
===================================================================
--- orbited/transports/base.py (revision 675)
+++ orbited/transports/base.py (working copy)
@@ -15,7 +15,7 @@
self.packets = []
self.request = request
self.opened()
-# self.request.notifiyFinish().addCallback(self.finished)
+ self.request.notifyFinish().addBoth(self.finished)
self.resetHeartbeat()
self.closeDeferred = defer.Deferred()
self.conn.transportOpened(self)
@@ -48,8 +48,12 @@
self.heartbeatTimer.cancel()
self.resetHeartbeat()
- # i don't think this is ever called...
def finished(self, arg):
+ """Callback and Errback for self.request.notifyFinish.
+
+ Commonly called because the connection is
+ lost before the response is sent.
+ """
logger.debug('finished: %s'%(arg,))
self.request = None
self.close()
Index: orbited/cometsession.py
===================================================================
--- orbited/cometsession.py (revision 675)
+++ orbited/cometsession.py (working copy)
@@ -67,7 +67,7 @@
else:
raise CannotListenError("Already listening...")
- def stopListening():
+ def stopListening(self):
self.logger.debug('stopListening')
if self.wrapped_port:
self.listening = False
@@ -94,7 +94,7 @@
transportProtocol.parentTransport = transport
protocol.makeConnection(transport)
- def getHost():
+ def getHost(self):
if self.wrapped_port:
return self.wrapped_port.getHost()
elif self.resource:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment