If the response that you get has Client-Warning
header, as seen in response below, then it is a tcp level error and response is produced by LWP client and not the server:
500 Server closed connection without sending any data back Content-Type: text/plain Client-Date: Thu, 19 Sep 2013 08:04:28 GMT Client-Warning: Internal response