Skip to content
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 demo issue #43

Closed
mmardinian opened this issue Mar 15, 2018 · 13 comments
Closed

websocket demo issue #43

mmardinian opened this issue Mar 15, 2018 · 13 comments
Labels

Comments

@mmardinian
Copy link

Hi,

I am interested in the websocket demo. The demo works with Firefox but it doesn't work with Chrome.
When the websocket connection request is sent, the websocket is created and then directly deleted.

Also, there is an issue with string handling.

  • The user data "my_user_data" has its 4 first bytes overwrited when passed to the websocket engine.
  • And string messages coming from the websocket client don't reach the incoming messages callback on the server.

Please let me know if I can support you.
Best regards,
Michael

@babelouest
Copy link
Owner

Hello,

Thanks for the bug report. Indeed the websocket example doesn't work for me too in Chrom[e|ium] browser and I don't know why yet, this looks very weird though. I found a related bug in Orcania. But this doesn't fix the websocket problem in Chrome yet.

Concerning the string handling issue, can you be more specific? I've retested the example using valgrind and nothing popped for valgrind, the memory was clean. If you confirm this memory problem, can you open a new issue in github?

Thanks for your help!

@babelouest babelouest added the bug label Mar 16, 2018
@babelouest
Copy link
Owner

Hello again,

I think I solved the problem on the websocket_example. Can you check the branch fix-websockets and tell me if the problem is fixed on your side? It's not complete yet because I've seen I'm not fully RFC compliant but this will be addressed soon.

@mmardinian
Copy link
Author

I checked out the branch but on my side it's worth.
It stills not work on chrome, and and doesn't work anymore on firefox... :/

@babelouest
Copy link
Owner

did you update orcania too? The branch fix-websockets in Ulfius is now plugged with the orcania branch fix-string_array_has_trimmed_value

@mmardinian
Copy link
Author

I had not the first time.
I did now but it didn't change a thing.
Neither Chrome or Firefox works for me now

@babelouest
Copy link
Owner

When you open the browser console (F12), what does the error say?

@mmardinian
Copy link
Author

For firefox:

WebSocket
binaryType: "blob"
bufferedAmount: 0
extensions: ""
onclose: function connectSocket/mySocket.onclose()
onerror: null
onmessage: function connectSocket/mySocket.onmessage()
onopen: null
protocol: ""
readyState: 3
url: "ws://10.0.164.36:9275/websocket"
proto: WebSocketPrototype { close: close(), send: send(), url: Getter, … }
index.html:37:4
Firefox ne peut établir de connexion avec le serveur à l’adresse ws://10.0.164.36:9275/websocket.

@babelouest
Copy link
Owner

What does the connection says in the network tab?

@mmardinian
Copy link
Author

*** Error im './websocket_example': double free or corruption (fasttop): 0x75300cf8 ***
Aborted (core dumped)

@babelouest
Copy link
Owner

I've pushed some more in the fix-websocket branch, including a change in Orcania. I was able to make the websocket work on my side.
I was able to run the websocket_example on Ubuntu 17.10 (amd64) with Firefox and Chromium, and also on a solid Raspberry Pi 2 running Raspbian Stretch.

Can you re-run your tests with this new code?

@mmardinian
Copy link
Author

Thanks that works now for both Chrome and Firefox.
Great support ;-)

@mmardinian
Copy link
Author

Could you please let me know when you will merge this corrective branch into the master?

@babelouest
Copy link
Owner

That's an excellent news!
It will be merged soon, probably today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants