In both ChannelEndPoint and SocketEndPoint, jetty is calling close() on the associated client socket.
This can lead to a race condition on the client side where jetty reads the request, writes the response and closes the socket before the client
can actually read the socket.
Jetty should only call socket.shutdownOutput() instead of close. shutdownOutput has the same effect of signaling that the socket is ready to be terminated but doesn't actually terminate it until the client does. From the javadoc:
For a TCP socket, any previously written data will be sent followed by TCP's normal connection termination sequence
This only happens when the Connection: close header is sent.
The attached patch removes the socket.close() call from SocketEndPoint and removes the socket.close()/channel.close() calls from ChannelEndPoint