diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2016-09-16 19:33:06 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2016-12-12 09:11:58 -0200 |
commit | 5d056170357acd0945899d7f0c40f530cbe816e0 (patch) | |
tree | a04cb4080e53777cba4b603cdc4a18c2edfeda3e /server/src/leap/soledad | |
parent | 1e3de25ce10156655bcb1bc879f5340baa889ead (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/src/leap/soledad')
-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) |