-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
websocket incoming messages empty #45
Comments
I'd like more informations please, starting with the system you're using (processor, OS, version), and more information on the problem itself. what text payload are you talking about? The one on the browser? the one on the websocket_example console? somewhere else? Thanks in advance for the precisions |
I work on an advanced replica of a raspberry Pi: The issue happens when you try to send a message from the browser interface (index.html) to the websocket. I had to modify first the example so the websocket doesn't close after sending its 5 messages to the client. So I try to send a simple word "test" writing it in the browser text box and then clicking on the send button. |
In When you say you had to |
Yes, that's what I did. |
can you post your updated |
There is just the "while" modification. `void websocket_manager_callback(const struct _u_request * request,
} |
I'm not sure actually where it comes from, I try to get all the information I need to reproduce the bug, and the only change you told me is in the |
So far I can't reproduce this bug, I transformed the |
What doo you mean when you say "advanced replica of a raspberry Pi"? Is it a physical machine or a VM? Which one? |
I've been into the u_websocket.c file in order to track the issue. |
The logs are provided by y_log_message(Y_LOG_LEVEL_DEBUG, "text payload '%.*s'", last_message->data_len, last_message->data); You can try the following lines instead to check where the problem would be.
If you want to debug directly the websocket incoming message manager, check the function ulfius_read_incoming_message. More precisely, the payload is set starting line 291 if I recall correctly: https://github.com/babelouest/ulfius/blob/fix-websockets/src/u_websocket.c#L291 |
ok so I put some logs in the u_websocket.c and the data are well displayed in the logs. |
OK, that's weird but at least we found out where the problem is. There is no problem in the data itself, just when displaying it with a limit number of chars. Can we consider this issue closed? |
Yes. |
Hi Nicolas,
In the websocket example, I always have text payload empty.
The message information however shows that some data have been received (data length isn't null).
But the data itself seems empty.
Please let me know need further information.
Thank you.
Michael
The text was updated successfully, but these errors were encountered: