summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-01-11 18:31:34 -0300
committerVictor Shyba <victor1984@riseup.net>2017-03-02 15:18:44 -0300
commit0b60027dacf331c103f764b7b1b5dee8b6123938 (patch)
treecca64601eca2ffa1dbfba46ec04a04bde26ce8c2
parentd92f1d1840d28ee6c2058556b047db75ed737f77 (diff)
[bug] handle error once
Handle it only if self.deferred wasnt called yet, otherwise that's just an out-of-sync call from a scheduled deferred. Since it was already logged, it's ok to ignore.
-rw-r--r--client/src/leap/soledad/client/http_target/fetch_protocol.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/client/src/leap/soledad/client/http_target/fetch_protocol.py b/client/src/leap/soledad/client/http_target/fetch_protocol.py
index fa6b1969..c7eabe2b 100644
--- a/client/src/leap/soledad/client/http_target/fetch_protocol.py
+++ b/client/src/leap/soledad/client/http_target/fetch_protocol.py
@@ -63,6 +63,8 @@ class DocStreamReceiver(ReadBodyProtocol):
Deliver the accumulated response bytes to the waiting L{Deferred}, if
the response body has been completely received without error.
"""
+ if self.deferred.called:
+ return
try:
if reason.check(ResponseDone):
self.dataBuffer = self.metadata
@@ -125,11 +127,7 @@ class DocStreamReceiver(ReadBodyProtocol):
else:
d = self._doc_reader(
self.current_doc, line.strip() or None, self.total)
- d.addErrback(self._error)
-
- def _error(self, reason):
- logger.error(reason)
- self.transport.loseConnection()
+ d.addErrback(self.deferred.errback)
def finish(self):
"""