Пример #1
0
 def connectionLost(self, reason):
     log.debug("Connection lost to %s: %s", self.peer, reason)
     self.setTimeout(None)
     self.connection_closed = True
     if reason.check(error.ConnectionDone):
         err = failure.Failure(ConnectionClosedBeforeResponseError())
     else:
         err = reason
     for key, d in self._response_deferreds.items():
         del self._response_deferreds[key]
         d.errback(err)
     if self._blob_download_request is not None:
         self._blob_download_request.cancel(err)
     self.factory.connection_was_made_deferred.callback(True)
Пример #2
0
 def connectionLost(self, reason):
     self.connection_closed = True
     if reason.check(error.ConnectionDone):
         err = failure.Failure(ConnectionClosedBeforeResponseError())
     else:
         err = reason
     #if self._response_deferreds:
     #    log.warning("Lost connection with active response deferreds. %s", str(self._response_deferreds))
     for key, d in self._response_deferreds.items():
         del self._response_deferreds[key]
         d.errback(err)
     if self._blob_download_request is not None:
         self._blob_download_request.cancel(err)
     self._connection_manager.protocol_disconnected(self.peer, self)