Commits

desmaj  committed fcc2665

applied https://gist.github.com/256582 (thanks Alex Clemesha)

  • Participants
  • Parent commits 3d44df7
  • Branches TRAC-131

Comments (0)

Files changed (2)

File daemon/orbited/cometsession.py

         else:
             raise CannotListenError("Already listening...")
 
-    def stopListening():
+    def stopListening(self):
         self.logger.debug('stopListening')
         if self.wrapped_port:
             self.listening = False
         transportProtocol.parentTransport = transport
         protocol.makeConnection(transport)
         
-    def getHost():
+    def getHost(self):
         if self.wrapped_port:
             return self.wrapped_port.getHost()
         elif self.resource:

File daemon/orbited/transports/base.py

         self.packets = []
         self.request = request
         self.opened()
-#        self.request.notifiyFinish().addCallback(self.finished)
+        self.request.notifiyFinish().addBoth(self.finished)
         self.resetHeartbeat()
         self.closeDeferred = defer.Deferred()
         self.conn.transportOpened(self)
             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()