actually write file when it says it is

This commit is contained in:
Mystikfluu 2023-05-27 22:15:51 +02:00
parent 86a5d97efc
commit 9de6bb5241

View File

@ -149,6 +149,8 @@ for packet in data_packets:
sha512 = sha512.hexdigest() sha512 = sha512.hexdigest()
total_data = b''.join(data_packets)
if sha512 != serverhash.hex(): if sha512 != serverhash.hex():
print('sha512: %s' % sha512) print('sha512: %s' % sha512)
print('server sha512: %s' % serverhash.hex()) print('server sha512: %s' % serverhash.hex())
@ -157,8 +159,6 @@ if sha512 != serverhash.hex():
f.write(total_data) f.write(total_data)
exit() exit()
total_data = b''.join(data_packets)
with open("received/"+filename, 'wb') as f: with open("received/"+filename, 'wb') as f:
f.write(total_data) f.write(total_data)