Description
In a known environment where the server fully reads full request bodies before sending a response, I would like to disable the expensive checkForEarlyResponse checks implemented by DefaultBHttpClientConnection.sendRequestEntity.
Using TLS the check blocks for 1ms every 8kb, which limits the upload rate to at most eight megabytes per second, relatively low in a data-center environment.
Proposed interface:
public interface ResponseOutOfOrderStrategy { /** * Returns the interval in bytes describing how often the socket is checked for an out-of-order response. * The default implementation uses 8kb. A value of zero results in checks being disabled, this may result * in requests blocking until the socket timeout is reached while a server sends an out-of-order response. */ int determineResponseCheckIntervalBytes(ClassicHttpRequest request, Socket socket); }
I'd be happy to implement and contribute such a feature if you agree that it's reasonable.
I appreciate any input and feedback you can provide!