This commit is contained in:
2019-12-16 22:02:28 +08:00
parent ae1db6e3ab
commit f8bcfcc9c0
4 changed files with 30 additions and 5 deletions

View File

@@ -92,7 +92,7 @@ class Netrecv:
print('Null data')
break
except Exception as e:
print('Decode error')
print('Decode error %s: %s' % (type(e), str(e)))
break
# try unpack #
@@ -138,6 +138,13 @@ class Netrecv:
aleady_write_down += still_need
data = new_data[still_need:]
else:
file = open(dp.head['filename'], 'wb')
file.write(data[:length])
data = data[length:]
file.close()
else: # dp.method is not 'file'
length = int(dp.head['length'])
data_length = len(data)