* 'master' of https://github.com/mikem2005/jclouds:
  Set connect and read timeout on connection
This commit is contained in:
Adrian Cole 2011-02-19 12:44:56 -08:00
commit 3602f03133
1 changed files with 6 additions and 0 deletions

View File

@ -172,6 +172,12 @@ public class JavaUrlHttpCommandExecutorService extends BaseHttpCommandExecutorSe
if (utils.trustAllCerts())
sslCon.setSSLSocketFactory(untrustedSSLContextProvider.get().getSocketFactory());
}
if (utils.getConnectionTimeout() > 0) {
connection.setConnectTimeout(utils.getConnectionTimeout());
}
if (utils.getSocketOpenTimeout() > 0) {
connection.setReadTimeout(utils.getSocketOpenTimeout());
}
connection.setDoOutput(true);
connection.setAllowUserInteraction(false);
// do not follow redirects since https redirects don't work properly