src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
Print this page
@@ -357,15 +357,15 @@
TUNNELING
}
private TunnelState tunnelState = TunnelState.NONE;
- /* Redefine timeouts from java.net.URLConnection as we nee -1 to mean
+ /* Redefine timeouts from java.net.URLConnection as we need -1 to mean
* not set. This is to ensure backward compatibility.
*/
- private int connectTimeout = -1;
- private int readTimeout = -1;
+ private int connectTimeout = NetworkClient.DEFAULT_CONNECT_TIMEOUT;
+ private int readTimeout = NetworkClient.DEFAULT_READ_TIMEOUT;
/* Logging support */
private static final PlatformLogger logger =
PlatformLogger.getLogger("sun.net.www.protocol.http.HttpURLConnection");
@@ -1039,13 +1039,13 @@
}
if (responseCode != 100) {
throw new ProtocolException("Server rejected operation");
}
}
- if (oldTimeout > 0) {
+
http.setReadTimeout(oldTimeout);
- }
+
responseCode = -1;
responses.reset();
// Proceed
}