simple-websocket icon indicating copy to clipboard operation
simple-websocket copied to clipboard

Wrong content when send/receive large message(about 4MB)

Open xfeep opened this issue 2 years ago • 2 comments

env: Linux (Ubuntu 22.04) + python 3.10.10 + simple-websocket 1.0.0

In this case both client and server are used together with flask + gevent + monkey.patch_all(). When the client send a large message the server will receive wrong conent which seems bad tail. e.g.

Client side:

sent:  msg size:3834249 
msg[0:10]:  b'\x80\x04\x95\xbf\x05\x00\x00\x00\x00\x00' 
msg[-10:]:  b't\x94bububub.'

Server side:

received:  msg size: 3834249
msg[0:10]: : b'\x80\x04\x95\xbf\x05\x00\x00\x00\x00\x00'
msg[-10:]: b'\xd4\xa5{i\xe2\xb0\xa6\xbc\x0b='

We can see the received tail is wrong. So either client or server gets wrong.

xfeep avatar Nov 30 '23 02:11 xfeep

Please create small server and client apps that I can use to reproduce this issue. The information you provided is insufficient for me to test or diagnose the issue. Thanks.

miguelgrinberg avatar Nov 30 '23 10:11 miguelgrinberg

@miguelgrinberg Hi, Grinberg! Thanks for your quick reply. If I'm free I'll try to create a minimal codebase to reproduce it. But now I've reverted back to using HTTP-PUT instead of websocket.

xfeep avatar Nov 30 '23 15:11 xfeep