< prev index next >

src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java

Print this page
rev 14342 : 8238579: HttpsURLConnection drops the timeout and hangs forever in read
Summary: HttpsURLConnection drops the timeout and hangs forever in read
Reviewed-by: dfuchs

*** 1,7 **** /* ! * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 91,104 **** * @param useCache whether the cached connection should be used * if present */ public void setNewClient (URL url, boolean useCache) throws IOException { http = HttpsClient.New (getSSLSocketFactory(), url, getHostnameVerifier(), ! useCache, this); ((HttpsClient)http).afterConnect(); } /** * Create a new HttpClient object, set up so that it uses --- 91,110 ---- * @param useCache whether the cached connection should be used * if present */ public void setNewClient (URL url, boolean useCache) throws IOException { + int readTimeout = getReadTimeout(); http = HttpsClient.New (getSSLSocketFactory(), url, getHostnameVerifier(), ! null, ! -1, ! useCache, ! getConnectTimeout(), ! this); ! http.setReadTimeout(readTimeout); ((HttpsClient)http).afterConnect(); } /** * Create a new HttpClient object, set up so that it uses
*** 144,157 **** protected void proxiedConnect(URL url, String proxyHost, int proxyPort, boolean useCache) throws IOException { if (connected) return; http = HttpsClient.New (getSSLSocketFactory(), url, getHostnameVerifier(), ! proxyHost, proxyPort, useCache, this); connected = true; } /** * Used by subclass to access "connected" variable. --- 150,169 ---- protected void proxiedConnect(URL url, String proxyHost, int proxyPort, boolean useCache) throws IOException { if (connected) return; + int readTimeout = getReadTimeout(); http = HttpsClient.New (getSSLSocketFactory(), url, getHostnameVerifier(), ! proxyHost, ! proxyPort, ! useCache, ! getConnectTimeout(), ! this); ! http.setReadTimeout(readTimeout); connected = true; } /** * Used by subclass to access "connected" variable.
< prev index next >