-
Notifications
You must be signed in to change notification settings - Fork 191
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
Fix ws/wss tcp socket leaks, closes #162 #163
Conversation
Scan-build compilation failed: https://public-artifacts.signalwire.cloud/drone/freeswitch/sofia-sip/294/scan-build-result.txt |
Since sofia doesn't have a proper http client, outgoing connections with ws/wss transport are not possible. Using the default tport_base_connect will lead into socket leaks, because they'll get created but never freed. Instead just define the proper vtp_connect function in ws/wss tranport which will always return NULL and make outgoing ws/wss connections to fail correctly.
adc2ecf
to
b90274e
Compare
Would be nice to have a way to reproduce that. |
Hi, there're two points here: first a logic error, since no connect callbacks are defined in sofia ws/wss transport the default tport_base_connect is used, which is not appropriate since has nothing to do with websockets and is not handled correctly (leading to socket leaks). Then, to simulate the leak the question is on how to force sofia ws/wss transport to do outgoing connections (which results into calling the default tport_base_connect which then create the leak because not cleared by the transport itselg). We reproduce this by:
|
Hi, I’m curious, do you use WS or WSS in your environment? |
Right now WS, proxied by nginx for SSL. WSS has some serious issues in corrupting stuff, like FS sqlite databases... go figure. Anyway, this patch is not related to WS or WSS, it applies to both. |
Thank you for the reply!
Yes, I asked you because we are struggling with SSL handling in sofia's WSS implementation.
We would also like to use WS with nginx, but since it doesn't handle passing the clients IP, we can't do this right now. |
Fixed by #233 |
Since sofia doesn't have a proper http client, outgoing connections with ws/wss transport are not possible.
Using the default tport_base_connect will lead into socket leaks, because they'll get created but never freed.
Instead just define the proper vtp_connect function in ws/wss tranport which will always return NULL and make outgoing ws/wss connections to fail correctly.