I'm implementing a HTTP server and wonder, if there is a defined way of when a server would determine a bad request as ended to
- return the corresponding 400 status, and
- accept the following data as new request starting a new attempt to parse it.
The only idea that comes to my mind would be a very ambiguous one: searching for the next request line-like data received and start a new parse attempt from there. However, this is, as said, a very ambiguous approach, since the data of a bad request may of course contain said 'request line-like' data without actually intending this to be a separate, new request.
The same question arises when thinking of client-side response parsing of malformed responses, so taking this case into account would be appreciated.