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

Browser displays the HTTP result and then quickly shows error page #7

Closed
centic9 opened this issue Sep 13, 2013 · 1 comment
Closed

Comments

@centic9
Copy link
Member

centic9 commented Sep 13, 2013

I tried the http= option of file-leak-detector on Windows, it worked fine there. But on Linux it behaves strangely, the Browser (Firefox 23.0) quickly displays the page, but then switches to an error page, telling me that the connection has been reset.

Sometimes it works, but especially when the application is under stress, it never manages to show the page correctly.

Any clue why this happens? I already tried to keep the Socket open for a bit longer in runHttpServer() and also tried to not close the Socket, it's the same behaviour.

I already tried to use a different GC or give the JVM more memory to rule out that the garbage collector collects the Socket too quickly somehow.

When I use "wget http://localhost:19999/", I get the same "connection has been reset" error message. Equally with curl.

@centic9
Copy link
Member Author

centic9 commented Sep 13, 2013

I think this is because the response is a simple string of bytes instead of a HTTP stream, thus some Browsers might display it if they access non-HTTP content, but others do not. Strange that it does work on Windows and not on Linux with the same browser, though.

I have exchanged the simple writing of bytes with a very simple HTTP implementation taken from https://github.com/NanoHttpd/nanohttpd, with this it works fine now, are you interesting in a pull request for such a change?

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

2 participants