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

Allow running client/server in a child thread. #7

Open
nitely opened this issue May 3, 2024 · 0 comments
Open

Allow running client/server in a child thread. #7

nitely opened this issue May 3, 2024 · 0 comments

Comments

@nitely
Copy link
Owner

nitely commented May 3, 2024

Right now the SSL context is stored in a thread var, and destroyed at program exit. This means if client/server is used in a child thread, the SSL will not be destroyed when the thread terminates, so it should leak. It probably also crashes at program exit with a SIGSEGV when it tries to destroy the SSL context.

One way to fix this is store a ref in the server and client context and destroy it on close, or offer a way to avoid destroy the thread var at program exit, and to manually destroy it before the thread terminates, or add a destructor (this is the best if possible).

Unless addExitProc callbacks are called at child thread exit. If so, then everything should work fine, and this issue can be closed.

Assuming asyncdispatch supports this in the first place.

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

No branches or pull requests

1 participant