Use the same maximum frame length for all transports.

This commit is contained in:
akwizgran
2015-01-05 16:24:44 +00:00
parent 358166bc12
commit d3bf2d59a1
60 changed files with 194 additions and 321 deletions

View File

@@ -75,8 +75,7 @@ class TorPlugin implements DuplexPlugin, EventHandler {
private final Context appContext;
private final LocationUtils locationUtils;
private final DuplexPluginCallback callback;
private final int maxFrameLength, maxLatency, maxIdleTime, pollingInterval;
private final int socketTimeout;
private final int maxLatency, maxIdleTime, pollingInterval, socketTimeout;
private final File torDirectory, torFile, geoIpFile, configFile, doneFile;
private final File cookieFile, hostnameFile;
private final AtomicBoolean circuitBuilt;
@@ -90,13 +89,11 @@ class TorPlugin implements DuplexPlugin, EventHandler {
TorPlugin(Executor ioExecutor, Context appContext,
LocationUtils locationUtils, DuplexPluginCallback callback,
int maxFrameLength, int maxLatency, int maxIdleTime,
int pollingInterval) {
int maxLatency, int maxIdleTime, int pollingInterval) {
this.ioExecutor = ioExecutor;
this.appContext = appContext;
this.locationUtils = locationUtils;
this.callback = callback;
this.maxFrameLength = maxFrameLength;
this.maxLatency = maxLatency;
this.maxIdleTime = maxIdleTime;
this.pollingInterval = pollingInterval;
@@ -117,10 +114,6 @@ class TorPlugin implements DuplexPlugin, EventHandler {
return ID;
}
public int getMaxFrameLength() {
return maxFrameLength;
}
public int getMaxLatency() {
return maxLatency;
}

View File

@@ -17,7 +17,6 @@ public class TorPluginFactory implements DuplexPluginFactory {
private static final Logger LOG =
Logger.getLogger(TorPluginFactory.class.getName());
private static final int MAX_FRAME_LENGTH = 1024;
private static final int MAX_LATENCY = 30 * 1000; // 30 seconds
private static final int MAX_IDLE_TIME = 30 * 1000; // 30 seconds
private static final int POLLING_INTERVAL = 3 * 60 * 1000; // 3 minutes
@@ -44,6 +43,6 @@ public class TorPluginFactory implements DuplexPluginFactory {
return null;
}
return new TorPlugin(ioExecutor,appContext, locationUtils, callback,
MAX_FRAME_LENGTH, MAX_LATENCY, MAX_IDLE_TIME, POLLING_INTERVAL);
MAX_LATENCY, MAX_IDLE_TIME, POLLING_INTERVAL);
}
}

View File

@@ -38,10 +38,6 @@ class TorTransportConnection implements DuplexTransportConnection {
private class Reader implements TransportConnectionReader {
public int getMaxFrameLength() {
return plugin.getMaxFrameLength();
}
public long getMaxLatency() {
return plugin.getMaxLatency();
}
@@ -59,10 +55,6 @@ class TorTransportConnection implements DuplexTransportConnection {
private class Writer implements TransportConnectionWriter {
public int getMaxFrameLength() {
return plugin.getMaxFrameLength();
}
public int getMaxLatency() {
return plugin.getMaxLatency();
}