aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Pyeron2012-09-10 17:50:10 (EDT)
committerMatthias Sohn2012-09-10 17:50:10 (EDT)
commit79d3dd839198c1ef10791fcc91973729d7755b31 (patch)
tree268451ae2130bfbbad67d027e459b34c2d6a3967
parente63f1c94f8f9a5b10da6c1e5932da33eb805230a (diff)
downloadjgit-79d3dd839198c1ef10791fcc91973729d7755b31.zip
jgit-79d3dd839198c1ef10791fcc91973729d7755b31.tar.gz
jgit-79d3dd839198c1ef10791fcc91973729d7755b31.tar.bz2
Ignore attempts to set the timeout to -1refs/changes/80/7680/4
The value of -1 is the default value used by the underlying http transports provided by the jre. On some versions an attempt to set the timeout explicitly to -1 triggers a check condition, disallowing negative numbers. Bug: 389003 Change-Id: I74a22f8edc6c8e15843ad07c96a137739d9dcad1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
index 2f68eb9..5796ab3 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
@@ -514,8 +514,12 @@ public class TransportHttp extends HttpTransport implements WalkTransport,
conn.setRequestProperty(HDR_ACCEPT_ENCODING, ENCODING_GZIP);
conn.setRequestProperty(HDR_PRAGMA, "no-cache"); //$NON-NLS-1$
conn.setRequestProperty(HDR_USER_AGENT, userAgent);
- conn.setConnectTimeout(getTimeout() * 1000);
- conn.setReadTimeout(getTimeout() * 1000);
+ int timeOut = getTimeout();
+ if (timeOut != -1) {
+ int effTimeOut = timeOut * 1000;
+ conn.setConnectTimeout(effTimeOut);
+ conn.setReadTimeout(effTimeOut);
+ }
authMethod.configureRequest(conn);
return conn;
}