Closed wolfieanmol closed 5 years ago
Images go out as multiple packets because image data is too big.
And yeah, will fix them.
Hmm, is there currently a flow in the code in which a list
is passed to _send_xmpp_element
?
In the serialize
method of OutgoingChatImage
, I'm dividing the data in packets of length 16384.
packets = [data[s:s+16384].encode() for s in range(0,len(data), 16384)]
return list(packets)
When the data is sent as a single packet. The server takes 3-5 seconds to respond with <ack>
which clearly showed that it was waiting for another packet.
Also, the received image is in multiple packets (2 packets generally).
Great feature. Just a few minor things:
_send_xmpp_element
, I'm not sure: in which situation we would want to send multiple packets at once?OutgoingGroupChatImage
.encode_base64
can beread_file_as_base64
or so (and also renameimage_file
).