summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2016-09-19 03:56:44 -0300
committerdrebs <drebs@leap.se>2016-12-12 09:11:58 -0200
commit07dcb2ae5240f20a26903f53a432fcd49c7f1ec9 (patch)
treef33354df809a5fbdd1771a1f07787e9e3b58af93 /server/src
parent35563cb74fcfd7f6ae969ed3af3a74d3c18cbf5b (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)