Skip to content

Commit

Permalink
fix when proxy tunneling failed (IOException is hidden) JDK-8173… (#901)
Browse files Browse the repository at this point in the history
fix when proxy tunneling failed (IOException is hidden) JDK-8173620
  • Loading branch information
marci4 committed Jun 26, 2019
2 parents c9e7533 + f73cca0 commit f580296
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/org/java_websocket/client/WebSocketClient.java
Expand Up @@ -28,6 +28,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Proxy;
Expand Down Expand Up @@ -480,6 +481,15 @@ public void run() {
onWebsocketError( engine, e );
engine.closeConnection( CloseFrame.NEVER_CONNECTED, e.getMessage() );
return;
} catch (InternalError e) {
// https://bugs.openjdk.java.net/browse/JDK-8173620
if (e.getCause() instanceof InvocationTargetException && e.getCause().getCause() instanceof IOException) {
IOException cause = (IOException) e.getCause().getCause();
onWebsocketError(engine, cause);
engine.closeConnection(CloseFrame.NEVER_CONNECTED, cause.getMessage());
return;
}
throw e;
}

writeThread = new Thread( new WebsocketWriteThread(this) );
Expand Down

0 comments on commit f580296

Please sign in to comment.