< prev index next >

src/java.base/share/classes/java/net/SocksSocketImpl.java

Print this page

        

*** 80,90 **** final int timeout) throws IOException { try { AccessController.doPrivileged( ! new java.security.PrivilegedExceptionAction<Void>() { public Void run() throws IOException { superConnectServer(host, port, timeout); cmdIn = getInputStream(); cmdOut = getOutputStream(); return null; --- 80,90 ---- final int timeout) throws IOException { try { AccessController.doPrivileged( ! new java.security.PrivilegedExceptionAction<>() { public Void run() throws IOException { superConnectServer(host, port, timeout); cmdIn = getInputStream(); cmdOut = getOutputStream(); return null;
*** 155,165 **** String userName; String password = null; final InetAddress addr = InetAddress.getByName(server); PasswordAuthentication pw = java.security.AccessController.doPrivileged( ! new java.security.PrivilegedAction<PasswordAuthentication>() { public PasswordAuthentication run() { return Authenticator.requestPasswordAuthentication( server, addr, serverPort, "SOCKS5", "SOCKS authentication", null); } }); --- 155,165 ---- String userName; String password = null; final InetAddress addr = InetAddress.getByName(server); PasswordAuthentication pw = java.security.AccessController.doPrivileged( ! new java.security.PrivilegedAction<>() { public PasswordAuthentication run() { return Authenticator.requestPasswordAuthentication( server, addr, serverPort, "SOCKS5", "SOCKS authentication", null); } });
*** 349,359 **** if (server == null) { // This is the general case // server is not null only when the socket was created with a // specified proxy in which case it does bypass the ProxySelector ProxySelector sel = java.security.AccessController.doPrivileged( ! new java.security.PrivilegedAction<ProxySelector>() { public ProxySelector run() { return ProxySelector.getDefault(); } }); if (sel == null) { --- 349,359 ---- if (server == null) { // This is the general case // server is not null only when the socket was created with a // specified proxy in which case it does bypass the ProxySelector ProxySelector sel = java.security.AccessController.doPrivileged( ! new java.security.PrivilegedAction<>() { public ProxySelector run() { return ProxySelector.getDefault(); } }); if (sel == null) {
*** 593,603 **** byte[] addr1 = baddr.getAddress(); /* Test for AnyLocal */ InetAddress naddr = baddr; if (naddr.isAnyLocalAddress()) { naddr = AccessController.doPrivileged( ! new PrivilegedAction<InetAddress>() { public InetAddress run() { return cmdsock.getLocalAddress(); } }); --- 593,603 ---- byte[] addr1 = baddr.getAddress(); /* Test for AnyLocal */ InetAddress naddr = baddr; if (naddr.isAnyLocalAddress()) { naddr = AccessController.doPrivileged( ! new PrivilegedAction<>() { public InetAddress run() { return cmdsock.getLocalAddress(); } });
*** 669,679 **** if (server == null) { // This is the general case // server is not null only when the socket was created with a // specified proxy in which case it does bypass the ProxySelector ProxySelector sel = java.security.AccessController.doPrivileged( ! new java.security.PrivilegedAction<ProxySelector>() { public ProxySelector run() { return ProxySelector.getDefault(); } }); if (sel == null) { --- 669,679 ---- if (server == null) { // This is the general case // server is not null only when the socket was created with a // specified proxy in which case it does bypass the ProxySelector ProxySelector sel = java.security.AccessController.doPrivileged( ! new java.security.PrivilegedAction<>() { public ProxySelector run() { return ProxySelector.getDefault(); } }); if (sel == null) {
*** 722,732 **** } // Connects to the SOCKS server try { AccessController.doPrivileged( ! new PrivilegedExceptionAction<Void>() { public Void run() throws Exception { cmdsock = new Socket(new PlainSocketImpl()); cmdsock.connect(new InetSocketAddress(server, serverPort)); cmdIn = cmdsock.getInputStream(); cmdOut = cmdsock.getOutputStream(); --- 722,732 ---- } // Connects to the SOCKS server try { AccessController.doPrivileged( ! new PrivilegedExceptionAction<>() { public Void run() throws Exception { cmdsock = new Socket(new PlainSocketImpl()); cmdsock.connect(new InetSocketAddress(server, serverPort)); cmdIn = cmdsock.getInputStream(); cmdOut = cmdsock.getOutputStream();
*** 753,763 **** + savedExc.getMessage()); } } else { try { AccessController.doPrivileged( ! new PrivilegedExceptionAction<Void>() { public Void run() throws Exception { cmdsock = new Socket(new PlainSocketImpl()); cmdsock.connect(new InetSocketAddress(server, serverPort)); cmdIn = cmdsock.getInputStream(); cmdOut = cmdsock.getOutputStream(); --- 753,763 ---- + savedExc.getMessage()); } } else { try { AccessController.doPrivileged( ! new PrivilegedExceptionAction<>() { public Void run() throws Exception { cmdsock = new Socket(new PlainSocketImpl()); cmdsock.connect(new InetSocketAddress(server, serverPort)); cmdIn = cmdsock.getInputStream(); cmdOut = cmdsock.getOutputStream();
< prev index next >