-
Notifications
You must be signed in to change notification settings - Fork 14
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
Move https.http_server's serve(...) function to to module top level #197
Conversation
trytls.bundles.https.http_server uses the multiprocessing module to run the HTTPS server in its own subprocess. On Unix systems the multiprocessing module creates subprocesses by forking. On Windows subprocesses get spawned, which requires the multiprocessing.Process target to be picklable. The multiprocessing.Process target serve() was previously defined inside http_server's scope, which made serve() unpicklable. This commit makes serve() picklable by moving it to the module top level and renames it to _serve() to signal that it's meant for internal use.
I managed to reproduce #196 by forcing the |
Seems to be working now:
Thanks for the quick fix 👍 |
looks good to me. |
Tested on the Windows 10. The original issue #196 appears to be fixed. However there was something strange with the openssl install I had in the localhost tests. See the paste below. I will merge this since this fixes the original issue and ignore the openssl issue for now.
|
This pull request is a potential fix for #196.
trytls.bundles.https.http_server
uses themultiprocessing
module to run the HTTPS server in its own subprocess. On Unix systems themultiprocessing
module creates subprocesses by forking. On Windows subprocesses get spawned, which requires themultiprocessing.Process
target to be picklable.The
multiprocessing.Process
targetserve
was previously defined insidehttp_server
's scope, which madeserve
unpicklable. The changes in this pull request makeserve
picklable by moving it to the module top level and renames it to_serve
to signal that it's meant for internal use.