I noticed some bad request data was coming in for a request and messing up the header data. This was traced down to a request handler that didn't read the form data from the request stream.
Should there be some guards in HTTPServerConnection to ensure that all the data has been read from the socket (belonging to the request). What happened is that the connection was keepAlive and the next request was getting this data instead. This can happen also if data is posted and no request handler is found. The default sendErrorResponce doesn't read the input stream so the next request will get this instead.
Something like this (available is a method I added to HTTPFixedLengthIOS for testing):
session.setKeepAlive(_pParams->getKeepAlive() && response.getKeepAlive() && session.canKeepAlive());
// Flush any data not read from the stream, otherwise the next
// request will get this data if keepAlive is used.
HTTPFixedLengthInputStream *fixedStream= dynamic_cast<HTTPFixedLengthInputStream *>(&request.stream());
if (session.getKeepAlive() && request.hasContentLength() && fixedStream)
else sendErrorResponse(session, HTTPResponse::HTTP_NOT_IMPLEMENTED);