public
Last active

  • Download Gist
orbited.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
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:

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.