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
Hang on the first connection after dropping/re-creating the server #244
Comments
What seems to be happening is that after the first request (and subsequent dropping of the server), there's still a thread left reading from the socket:
Why is it saying it's in |
This makes some sense - the connection is being kept alive (since the browser asked it to be via |
Explicitly setting a |
You could also use The thing with |
I ended up switching to
For (3) and (4) I'm not sure, as I don't have this code path to try anymore. Agreed that the |
I'm trying to use
tiny-http
as an oauth redirect server on localhost in a desktop app. Since I don't want the server running constantly, during login I:This works great the first time. The second time, the browser hangs. If I refresh the page, it works.
I managed to boil it down to this example:
To reproduce:
http://localhost:9975
in your browser. It will redirect to Google.http://localhost:9975
in your browser again. It hangs.http://localhost:9975
in your browser again. It works this time.Interestingly, using
curl
instead of the browser does not reproduce the issue.Also, if I change the port each time the problem goes away. However, if I loop between a fixed number of ports, as soon as a port is being recycled, the problem happens again.
This is on Windows. I haven't checked other platforms yet.
The text was updated successfully, but these errors were encountered: