summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2016-09-19 03:56:44 -0300
committerVictor Shyba <victor1984@riseup.net>2016-11-18 15:55:52 -0300
commit93a8be4a374a4863a36c99e5cca5eed8e6568d15 (patch)
tree6202c2f6aed8b076268db439af69337430fe31d3 /server/src
parent9cde27c4da477aef3e049c49bff1ac917eb51123 (diff)
[feature] streaming download protocol
This commit finishes reversion into u1db original streaming protocol for downloads.
Diffstat (limited to 'server/src')
-rw-r--r--server/src/leap/soledad/server/sync.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/src/leap/soledad/server/sync.py b/server/src/leap/soledad/server/sync.py
index 6f2ffe9f..c958bfaa 100644
--- a/server/src/leap/soledad/server/sync.py
+++ b/server/src/leap/soledad/server/sync.py
@@ -254,7 +254,11 @@ class SyncResource(http_app.SyncResource):
gen=gen, trans_id=trans_id)
self.responder.stream_entry(entry)
content = doc.get_json()
- self.responder.stream_entry(content.read() if content else '')
+ if content:
+ self.responder.stream_entry(content.read())
+ content.close()
+ else:
+ self.responder.stream_entry('')
new_gen, number_of_changes = \
self.sync_exch.find_changes_to_return(received)