From ea3eea052069d5cc933937fd077d94569e4336a4 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 16 Sep 2016 19:34:37 -0300 Subject: [feature] simple adaptation to let the client run Make the client parse a 2-line doc on sync download stream. --- client/src/leap/soledad/client/http_target/fetch.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client') 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 -- cgit v1.2.3