Partial output was caused by failing to read the HTTP request. This patch reads the HTTP request into a temporary buffer before discarding it.
This patch creates an endless loop on unrecoverable socket errors. See read(3) for more information about return codes. Please provide more information if I am wrong.
Best regards, Sven