-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Due to the way the recv works in the server, it can't handle situations where multiple information come via the same websocket message at once.
Example
myserver._decode_data_frame(b'\x89\x80z\x95`\xc7\x81\xfe\x00\x95j\xb1\n\x00\x11\x93ov\x0f\xdf~"P')
# Recognizes as a PINGIn the above case a ping comes and directly after a valid payload is followed but is totally discarded by the server.
The culprit is in this code
def _recv(self, client, user=False):
"""Receive a message from the client. Will block this thread until a message is received.
:param client: The client to receive a message from.
"""
try:
address = client.getpeername()
data = client.recv(2048)
..The right approach would be to read the message byte-by-byte instead of an arbitrary chunk.
Metadata
Metadata
Assignees
Labels
No labels