diff --git a/transmat/transmat.py b/transmat/transmat.py index 133184e..1d444e4 100755 --- a/transmat/transmat.py +++ b/transmat/transmat.py @@ -171,7 +171,7 @@ async def main(): i = 1 number_of_chunks = None while True: - if number_of_chunks is not None and i > number_of_chunks: + if number_of_chunks is not None and i > number_of_chunks + 1: bar.index = 100 bar.suffix = '%(percent).1f%% complete' bar.update() @@ -193,7 +193,7 @@ async def main(): else: f.write(msg["chunk"]) msgtype = "proceed" - i += 1 # This increment has to happen before we try to send the confirmation message + i += 1 await send_encrypted_msg(ws, k, (msgtype, peer_group_id, role, "", "", "", "", "")) # request the next chunk from sender bar.suffix = "%(percent).1f%% complete - %(eta_td)s remaining " + str(i) + "/" + str(number_of_chunks) + " msg sent" bar.next()