diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2016-09-16 19:34:37 -0300 |
---|---|---|
committer | Victor Shyba <victor1984@riseup.net> | 2016-11-18 15:55:52 -0300 |
commit | a96212203e80ca0d39ed783f9d72ebad019d772b (patch) | |
tree | 55e9fe2733c572d23b5fcc07bf61c9aec8da4147 /client | |
parent | f1f0b6fced4e100fa1aed73fd64bca43c239ccc5 (diff) |
[feature] simple adaptation to let the client run
Make the client parse a 2-line doc on sync download stream.
Diffstat (limited to 'client')
-rw-r--r-- | client/src/leap/soledad/client/http_target/fetch.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/leap/soledad/client/http_target/fetch.py b/client/src/leap/soledad/client/http_target/fetch.py index 0fb5040f..24d73025 100644 --- a/client/src/leap/soledad/client/http_target/fetch.py +++ b/client/src/leap/soledad/client/http_target/fetch.py @@ -200,11 +200,12 @@ class HTTPDocFetcher(object): self._ensure_callback(metadata['replica_uid']) # parse incoming document info entries = [] - for data in data[1:]: + for index in xrange(1, len(data[1:]), 2): try: - line, comma = utils.check_and_strip_comma(data) + line, comma = utils.check_and_strip_comma(data[index]) + content, _ = utils.check_and_strip_comma(data[index + 1]) entry = json.loads(line) - entries.append((entry['id'], entry['rev'], entry['content'], + entries.append((entry['id'], entry['rev'], content, entry['gen'], entry['trans_id'])) except (IndexError, KeyError): raise errors.BrokenSyncStream |