< prev index next >

src/java.net.http/share/classes/jdk/internal/net/http/websocket/OpeningHandshake.java

Print this page
rev 54081 : 8265099: Revert backport to 11u of 8236859: WebSocket over authenticating proxy fails with NPE
Summary: Revert https://hg.openjdk.java.net/jdk-updates/jdk11u-dev/rev/57e3fa3574ec
Reviewed-by:

*** 1,7 **** /* ! * Copyright (c) 2015, 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 --- 1,7 ---- /* ! * Copyright (c) 2015, 2019, 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
*** 213,242 **** // // Listener.onClose(StatusCodes.TLS_HANDSHAKE_FAILURE, "") // // See https://tools.ietf.org/html/rfc6455#section-7.4.1 Result result = null; ! Throwable exception = null; try { result = handleResponse(response); } catch (IOException e) { exception = e; } catch (Exception e) { exception = new WebSocketHandshakeException(response).initCause(e); - } catch (Error e) { - // We should attempt to close the connection and relay - // the error through the completable future even in this - // case. - exception = e; } if (exception == null) { return MinimalFuture.completedFuture(result); } try { ! // calling this method will close the rawChannel, if created, ! // or the connection, if not. ! ((RawChannel.Provider) response).closeRawChannel(); } catch (IOException e) { exception.addSuppressed(e); } return MinimalFuture.failedFuture(exception); } --- 213,235 ---- // // Listener.onClose(StatusCodes.TLS_HANDSHAKE_FAILURE, "") // // See https://tools.ietf.org/html/rfc6455#section-7.4.1 Result result = null; ! Exception exception = null; try { result = handleResponse(response); } catch (IOException e) { exception = e; } catch (Exception e) { exception = new WebSocketHandshakeException(response).initCause(e); } if (exception == null) { return MinimalFuture.completedFuture(result); } try { ! ((RawChannel.Provider) response).rawChannel().close(); } catch (IOException e) { exception.addSuppressed(e); } return MinimalFuture.failedFuture(exception); }
< prev index next >