aldexis opened a new pull request, #573: URL: https://github.com/apache/httpcomponents-core/pull/573
# Problem Description https://github.com/apache/httpcomponents-core/pull/508 made a change to `HttpRequestExecutor` to ensure a prompt connection close, especially upon a `SocketTimeoutException`, by closing the connection with `CloseMode.IMMEDIATE`. However, this does not work properly if the connection's socket was bound not through the `bind(SSLSocket, Socket)` method added in https://github.com/apache/httpcomponents-core/pull/468 and instead by passing the `SSLSocket` directly to `bind(SSLSocket)`. This is for instance what happens in `httpcomponents-client` < 5.4 in [`DefaultHttpClientConnectionOperator`](https://github.com/apache/httpcomponents-client/blob/rel/v5.3.1/httpclient5/src/main/java/org/apache/hc/client5/http/impl/io/DefaultHttpClientConnectionOperator.java#L189-L190). # Proposed Solution While it's probably undesirable to do what happens in the described example above, this very much can happen. On the other hand, setting the socket timeout to something very low when we want to close it _immediately_ seems reasonable, hence my proposal for this change. # Testing considerations I am unfortunately not terribly familiar with this codebase and I have done my best to provide a reproducer test, but that had to rely on _not_ using the provided `HttpRequester` from the test setup, because it is not subject itself to the issue I've described here. The classes I've used are however all part of the public API, hence seemed reasonable to test directly. I'd be happy to update or move the test in any way that you would prefer. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
