mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8216978: Drop support for pre JDK 1.4 SocketImpl implementations
Reviewed-by: chegar, alanb, dfuchs
This commit is contained in:
parent
5a496e21d5
commit
70ea5ab6e1
14 changed files with 109 additions and 463 deletions
|
@ -51,6 +51,7 @@ import java.util.Set;
|
|||
private static final Method doTunneling;
|
||||
|
||||
private final String server;
|
||||
private final Socket socket;
|
||||
private InetSocketAddress external_address;
|
||||
private HashMap<Integer, Object> optionsMap = new HashMap<>();
|
||||
|
||||
|
@ -75,8 +76,9 @@ import java.util.Set;
|
|||
}
|
||||
}
|
||||
|
||||
HttpConnectSocketImpl(Proxy proxy, SocketImpl delegate) {
|
||||
HttpConnectSocketImpl(Proxy proxy, SocketImpl delegate, Socket socket) {
|
||||
super(delegate);
|
||||
this.socket = socket;
|
||||
SocketAddress a = proxy.address();
|
||||
if ( !(a instanceof InetSocketAddress) )
|
||||
throw new IllegalArgumentException("Unsupported address type");
|
||||
|
@ -96,17 +98,6 @@ import java.util.Set;
|
|||
connect(new InetSocketAddress(address, port), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
void setSocket(Socket socket) {
|
||||
delegate.socket = socket;
|
||||
super.setSocket(socket);
|
||||
}
|
||||
|
||||
@Override
|
||||
void setServerSocket(ServerSocket socket) {
|
||||
throw new InternalError("should not get here");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void connect(SocketAddress endpoint, int timeout)
|
||||
throws IOException
|
||||
|
@ -137,7 +128,7 @@ import java.util.Set;
|
|||
|
||||
// update the Sockets impl to the impl from the http Socket
|
||||
SocketImpl si = httpSocket.impl;
|
||||
getSocket().setImpl(si);
|
||||
socket.setImpl(si);
|
||||
|
||||
// best effort is made to try and reset options previously set
|
||||
Set<Map.Entry<Integer,Object>> options = optionsMap.entrySet();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue