Fix infinite socket timeout when using ApacheHCHttpCommandExecutorServiceModule (#51)

Because the Java type BasicHttpParams wasn't matching the one returned
by provider "newBasicHttpParams" (which is returning a HttpParams type), it was configuring the Apache HTTP client with default settings (including connection and socket timeout), ignoring the ones of JClouds which were must safer in this regard (JCloudsones are currently 60sec for both, while Apache HC ones are -1, so infinite). It also prevented to override those default/infinite timeout settings with JClouds ones.
This commit is contained in:
Xavier BOURGOUIN 2019-10-23 11:44:58 +02:00 committed by Ignasi Barrera
parent f5b29c7028
commit 316b74db94
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ public class ApacheHCHttpCommandExecutorServiceModule extends AbstractModule {
@Provides
@Singleton
final HttpClient newDefaultHttpClient(ProxyConfig config, BasicHttpParams params, ClientConnectionManager cm) {
final HttpClient newDefaultHttpClient(ProxyConfig config, HttpParams params, ClientConnectionManager cm) {
DefaultHttpClient client = new DefaultHttpClient(cm, params);
if (config.useSystem()) {
ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(client.getConnectionManager()