diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2016-09-16 19:33:06 -0300 |
---|---|---|
committer | Victor Shyba <victor1984@riseup.net> | 2016-11-18 15:55:52 -0300 |
commit | f1f0b6fced4e100fa1aed73fd64bca43c239ccc5 (patch) | |
tree | 8f03f744f46188e1ce51ece5a37649ce98da8a1a /server | |
parent | a6f36826e23afcfcc4194198a44fdbfd3afc3492 (diff) |
[feature] server download stream from file object
couchdb lib returns a file object representing the attachment. This
commit dumps the read() call into the wsgi write() call. Doc
representation uses 2 lines also, separating metadata from content.
Diffstat (limited to 'server')
-rw-r--r-- | server/src/leap/soledad/server/sync.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/src/leap/soledad/server/sync.py b/server/src/leap/soledad/server/sync.py index a0324a27..253139a9 100644 --- a/server/src/leap/soledad/server/sync.py +++ b/server/src/leap/soledad/server/sync.py @@ -248,9 +248,10 @@ class SyncResource(http_app.SyncResource): """ def send_doc(doc, gen, trans_id): - entry = dict(id=doc.doc_id, rev=doc.rev, content=doc.get_json(), + entry = dict(id=doc.doc_id, rev=doc.rev, gen=gen, trans_id=trans_id) self.responder.stream_entry(entry) + self.responder.stream_entry(doc.get_json().read()) new_gen, number_of_changes = \ self.sync_exch.find_changes_to_return(received) |