HttpURLConnection.doTunneling can fail with IOE niosocketimpl-branch
authoralanb
Fri, 01 Mar 2019 18:28:44 +0000
branchniosocketimpl-branch
changeset 57238 b145b1b04106
parent 57237 a0ad3ffd7b60
child 57239 7636aef1b197
HttpURLConnection.doTunneling can fail with IOE
src/java.base/share/classes/java/net/HttpConnectSocketImpl.java
--- a/src/java.base/share/classes/java/net/HttpConnectSocketImpl.java	Fri Mar 01 17:40:16 2019 +0000
+++ b/src/java.base/share/classes/java/net/HttpConnectSocketImpl.java	Fri Mar 01 18:28:44 2019 +0000
@@ -209,10 +209,14 @@
         }
     }
 
-    private void doTunneling(HttpURLConnection conn) {
+    private void doTunneling(HttpURLConnection conn) throws IOException {
         try {
             doTunneling.invoke(conn);
         } catch (ReflectiveOperationException x) {
+            Throwable cause = x.getCause();
+            if (cause instanceof IOException) {
+                throw (IOException) cause;
+            }
             throw new InternalError("Should not reach here", x);
         }
     }