summaryrefslogtreecommitdiff
path: root/tools/mergetools.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2016-03-15 12:52:51 +0100
committerMagnus Ahltorp <map@kth.se>2016-03-15 12:52:51 +0100
commit06c6290ac4f0507374dfbf703e6577dfe48dfae7 (patch)
tree88192d87d3dcd0c4d2f4045208c9d9e2723bd80e /tools/mergetools.py
parent3629b8bd60f9d14828bcd6a0feb3f948c95351f0 (diff)
Do detection of where log ends before sending new hashes
Try to send entries until missing entries is empty
Diffstat (limited to 'tools/mergetools.py')
-rw-r--r--tools/mergetools.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/mergetools.py b/tools/mergetools.py
index f6e8bd5..ec4fd2a 100644
--- a/tools/mergetools.py
+++ b/tools/mergetools.py
@@ -286,13 +286,14 @@ def sendentry(node, baseurl, own_key, paths, entry, ehash):
def sendentry_merge(node, baseurl, own_key, paths, entry, ehash):
return sendentries_merge(node, baseurl, own_key, paths, [(ehash, entry)])
-def sendentries_merge(node, baseurl, own_key, paths, entries):
+def sendentries_merge(node, baseurl, own_key, paths, entries, session=None):
try:
json_entries = [{"entry":base64.b64encode(entry), "treeleafhash":base64.b64encode(hash)} for hash, entry in entries]
result = http_request(
baseurl + "plop/v1/merge/sendentry",
json.dumps(json_entries),
- key=own_key, verifynode=node, publickeydir=paths["publickeys"])
+ key=own_key, verifynode=node, publickeydir=paths["publickeys"],
+ session=session)
return json.loads(result)
except requests.exceptions.HTTPError, e:
print >>sys.stderr, "ERROR: sendentry_merge", e.response