i2ptunnel: Force connect delay and bulk profile for most

client tunnel types, and hide from UI
Reduce delay
Set IRC to bulk
This commit is contained in:
zzz
2019-04-25 16:16:32 +00:00
parent 5f01796bae
commit 981737f8ed
7 changed files with 20 additions and 8 deletions

View File

@ -227,8 +227,6 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
super(localPort, l, sockMgr, tunnel, notifyThis, clientId);
_proxyNonce = Long.toString(_context.random().nextLong());
// proxyList = new ArrayList();
if (tunnel.getClientOptions().getProperty("i2p.streaming.connectDelay") == null)
tunnel.getClientOptions().setProperty("i2p.streaming.connectDelay", "1000");
setName("HTTP Proxy on " + getTunnel().listenHost + ':' + localPort);
notifyEvent("openHTTPClientResult", "ok");
@ -255,8 +253,6 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
_proxyList.add(tok.nextToken().trim());
}
}
if (tunnel.getClientOptions().getProperty("i2p.streaming.connectDelay") == null)
tunnel.getClientOptions().setProperty("i2p.streaming.connectDelay", "1000");
setName("HTTP Proxy on " + tunnel.listenHost + ':' + localPort);
notifyEvent("openHTTPClientResult", "ok");

View File

@ -277,6 +277,10 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
EventDispatcher notifyThis, String handlerName,
I2PTunnel tunnel) throws IllegalArgumentException {
super(localPort, ownDest, l, notifyThis, handlerName, tunnel);
// force connect delay and bulk profile
Properties opts = tunnel.getClientOptions();
opts.setProperty("i2p.streaming.connectDelay", "200");
opts.remove("i2p.streaming.maxWindowSize");
_proxyList = new ArrayList<String>(4);
_proxyNonce = new byte[PROXYNONCE_BYTES];
_context.random().nextBytes(_proxyNonce);
@ -293,6 +297,10 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
I2PTunnel tunnel, EventDispatcher notifyThis, long clientId )
throws IllegalArgumentException {
super(localPort, l, sktMgr, tunnel, notifyThis, clientId);
// force connect delay and bulk profile
Properties opts = tunnel.getClientOptions();
opts.setProperty("i2p.streaming.connectDelay", "200");
opts.remove("i2p.streaming.maxWindowSize");
_proxyList = new ArrayList<String>(4);
_proxyNonce = new byte[PROXYNONCE_BYTES];
_context.random().nextBytes(_proxyNonce);

View File

@ -62,6 +62,10 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase {
l,
notifyThis,
"IRC Client on " + tunnel.listenHost + ':' + localPort, tunnel, pkf);
// force connect delay and bulk profile
Properties opts = tunnel.getClientOptions();
opts.setProperty("i2p.streaming.connectDelay", "200");
opts.remove("i2p.streaming.maxWindowSize");
_addrs = new ArrayList<I2PSocketAddress>(4);
buildAddresses(destinations);

View File

@ -51,6 +51,10 @@ public class I2PSOCKSTunnel extends I2PTunnelClientBase {
*/
public I2PSOCKSTunnel(int localPort, Logging l, boolean ownDest, EventDispatcher notifyThis, I2PTunnel tunnel, String pkf) {
super(localPort, ownDest, l, notifyThis, "SOCKS Proxy on " + tunnel.listenHost + ':' + localPort, tunnel, pkf);
// force connect delay and bulk profile
Properties opts = tunnel.getClientOptions();
opts.setProperty("i2p.streaming.connectDelay", "200");
opts.remove("i2p.streaming.maxWindowSize");
setName("SOCKS Proxy on " + tunnel.listenHost + ':' + localPort);
parseOptions();

View File

@ -480,7 +480,7 @@ class SOCKS5Server extends SOCKSServer {
*/
private I2PSocket outproxyConnect(I2PSOCKSTunnel tun, String proxy) throws IOException, I2PException {
Properties overrides = new Properties();
overrides.setProperty("option.i2p.streaming.connectDelay", "1000");
overrides.setProperty("option.i2p.streaming.connectDelay", "200");
I2PSocketOptions proxyOpts = tun.buildOptions(overrides);
Destination dest = _context.namingService().lookup(proxy);
if (dest == null)

View File

@ -930,7 +930,7 @@ public class TunnelConfig {
updateTunnelQuantities(config);
if (_connectDelay)
config.setProperty("option.i2p.streaming.connectDelay", "1000");
config.setProperty("option.i2p.streaming.connectDelay", "500");
else
config.setProperty("option.i2p.streaming.connectDelay", "0");
if (TunnelController.isClient(_type) && _sharedClient) {