< prev index next >

src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java

Print this page
rev 54110 : 8244205: HTTP/2 tunnel connections through proxy may be reused regardless of which proxy is selected
Summary: The key used in the HTTP/2 connection pool is updated to take into account the proxy address in case of tunnel connections
Reviewed-by: chegar

*** 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 --- 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
*** 134,143 **** --- 134,151 ---- * Returns true for tunnel connections, or clear connection to * any host through proxy. */ abstract boolean isProxied(); + /** + * Returns the address of the proxy used by this connection. + * Returns the proxy address for tunnel connections, or + * clear connection to any host through proxy. + * Returns {@code null} otherwise. + */ + abstract InetSocketAddress proxy(); + /** Tells whether, or not, this connection is open. */ final boolean isOpen() { return channel().isOpen() && (connected() ? !getConnectionFlow().isFinished() : true); }
< prev index next >