From 5d056170357acd0945899d7f0c40f530cbe816e0 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 16 Sep 2016 19:33:06 -0300 Subject: [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. --- server/src/leap/soledad/server/sync.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/src/leap/soledad') 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) -- cgit v1.2.3