Open edufschmidt opened 8 years ago
Thanks a lot for the report and the code example. With it, it was quite easy to fix the problems.
Thank you for the quick reply and for this awesome library!
Hi David, I'm forced to ask you to reopen this issue. I've conducted a few more tests and the problem persists, even though the minimum message length for it to happen is a bit larger now (don't know the exact length yet).
I will try to do more tests. If you got more information please post it here.
I'm having the same problem. When receiving about 350 bytes data_ready_length
reports over 30K bytes. onion_websocket_read()
returns the right number of bytes but the callback fires again but this time onion_websocket_read()
returns EAGAIN
and segfaults soon after the callback returns.
Hi there!
I have recently faced an issue when sending messages larger than 125 bytes to a websocket server written using onion. I noticed that when the data received is shorter than 125 bytes, everything works fine. However, as soon as a payload of 126 bytes or more is received, the server crashes with a segfault. I logged the third argument in the websocket callback (
data_ready_len
), and it is seems to assume an incorrect value if the received payload is larger than 125 bytes. It's interesting that a payload length of 126, for instance, caused thedata_ready_len
value to become0x7E00
, instead of0x7E
, as expected. When the payload size is of 127 bytes(0x7F)
, thedata_ready_len
value is of0x7F00
. I believe this could also be the cause of the segfault, and might indicate an endianess issue, or some incorrect masking somewhere within Onion. Below are my server and client (js) code:Server:
Client:
PS.: I performed all tests in a 64 bit PC running Linux (
Linux 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
)Please let me know if I can help with more information, or if you think the problem is caused by some mistake on my end.