Open mlohbihler opened 5 years ago
I have experienced this too, all I did was use a curl request.
Does it still happen in 2.3.1?
I am seeing the same issue as well, even off of the current working tree. The issue stems from not being able to find a cut point between the headers and the body.
The InputStream is then reset and read again, since we are starting over at the beginning. I'm not sure if that request complies with the spec, but the implementation should handle this gracefully.
Adding either \r\n\r\n
or \n\n
to the end of that request should resolve the issue.
It is possible to get an instance of NanoHTTPD into an infinite loop by causing an exception in the
send
method which would write the "Could not send response to the client" log message. The following code will produce this when you have a webserver running locally on port 8080:Immediately closing the socket prevents the server from being able to write the response, producing the error. I have been consistently able to produce this condition in version 2.2.0.