forked from I2P_Developers/i2p.i2p
* I2PTunnel:
- Switch all I2PThreads to I2PAppThreads - Run an InternalSocket as well for the HTTP Proxy * EepGet: Use InternalSocket * Console: Change "depth" to "length"
This commit is contained in:
@ -16,6 +16,7 @@ import java.util.StringTokenizer;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.InternalSocket;
|
||||
|
||||
/**
|
||||
* EepGet [-p 127.0.0.1:4444]
|
||||
@ -869,7 +870,7 @@ public class EepGet {
|
||||
if (_proxy != null) try { _proxy.close(); } catch (IOException ioe) {}
|
||||
|
||||
if (_shouldProxy) {
|
||||
_proxy = new Socket(_proxyHost, _proxyPort);
|
||||
_proxy = InternalSocket.getSocket(_proxyHost, _proxyPort);
|
||||
} else {
|
||||
try {
|
||||
URL url = new URL(_actualURL);
|
||||
|
@ -63,13 +63,24 @@ public class InternalSocket extends Socket {
|
||||
@Override
|
||||
public void close() {
|
||||
try {
|
||||
if (_is != null) _is.close();
|
||||
if (_is != null) {
|
||||
_is.close();
|
||||
_is = null;
|
||||
}
|
||||
} catch (IOException ie) {}
|
||||
try {
|
||||
if (_os != null) _os.close();
|
||||
if (_os != null) {
|
||||
_os.close();
|
||||
_os = null;
|
||||
}
|
||||
} catch (IOException ie) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClosed() {
|
||||
return _is == null || _os == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ("Internal socket");
|
||||
@ -183,11 +194,6 @@ public class InternalSocket extends Socket {
|
||||
}
|
||||
/** @deprecated unsupported */
|
||||
@Override
|
||||
public boolean isClosed() {
|
||||
throw new IllegalArgumentException("unsupported");
|
||||
}
|
||||
/** @deprecated unsupported */
|
||||
@Override
|
||||
public boolean isConnected() {
|
||||
throw new IllegalArgumentException("unsupported");
|
||||
}
|
||||
|
Reference in New Issue
Block a user