diff --git a/transmat.py b/transmat.py index ea9961c..a026092 100755 --- a/transmat.py +++ b/transmat.py @@ -9,7 +9,7 @@ from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC from progress.bar import Bar -VERSION_NUMBER="0.1" +VERSION_NUMBER="0.1.1" async def read_chunks(filename, chunk_size = 1024): @@ -156,9 +156,11 @@ async def main(): msg = (msgtype, peer_group_id, role, filename, chunk_size, chunk_id, number_of_chunks, chunk) await send_encrypted_msg(ws, k, msg) await asyncio.sleep(0.05) + chunk_id += 1 + if chunk_id > number_of_chunks: + break proceed = await ws.recv() bar.next() - chunk_id += 1 bar.suffix = '%(percent).1f%% done' print("\n")