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

Win10: CMD hangs on CTRL+C event after GET request #4

Open
gimmx opened this issue Feb 19, 2020 · 2 comments
Open

Win10: CMD hangs on CTRL+C event after GET request #4

gimmx opened this issue Feb 19, 2020 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@gimmx
Copy link

gimmx commented Feb 19, 2020

Starting the server with "updog" allows stopping the server with CTRL+C. However, after navigation and subsequent console output, the terminal hangs when attempting to capture CTRL+C event. The delay seems to be coupled with some internal I/O block and does not properly listen for the stop signal.

@sc0tfree sc0tfree added the bug Something isn't working label Feb 19, 2020
@sc0tfree
Copy link
Owner

I have verified this on Windows 10. Seems like SIGINT stops sending only after a file download as it still works after just a GET request.

Can't seem to find out the right fix, but looks like there is an issue with werkzeug and signal libraries on Windows.

Anyone have ideas on this one?

signal.signal(signal.SIGINT, handler)

@sc0tfree sc0tfree added the help wanted Extra attention is needed label Feb 19, 2020
@adeutscher
Copy link

This might be a bit apples and oranges, but I had a control-C problem with my SimpleHTTPServer+ThreadingMixIn-based script. Ctrl-C-ing out of the script while a download was in motion would hang until every client thread died down.

In order to solve this, I overrode the method responsible for serving content with a version that checked for an 'alive' attribute on the main server object. On a ctrl-C, 'alive' is set to False and the client file-serving loop breaks. This allows the client thread to die. https://github.com/adeutscher/core-tools/blob/93efb12e780964fd4079c79201e7966e2824327b/scripts/networking/http-servers/CoreHttpServer.py#L682

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants