I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 5ed22d5c authored by zzz's avatar zzz
Browse files

cleanups

parent 525e0b45
No related branches found
No related tags found
No related merge requests found
...@@ -357,6 +357,9 @@ public class FileUtil { ...@@ -357,6 +357,9 @@ public class FileUtil {
* Dump the contents of the given path (relative to the root) to the output * Dump the contents of the given path (relative to the root) to the output
* stream. The path must not go above the root, either - if it does, it will * stream. The path must not go above the root, either - if it does, it will
* throw a FileNotFoundException * throw a FileNotFoundException
*
* Closes the OutputStream out on successful completion
* but leaves it open when throwing IOE.
*/ */
public static void readFile(String path, String root, OutputStream out) throws IOException { public static void readFile(String path, String root, OutputStream out) throws IOException {
File rootDir = new File(root); File rootDir = new File(root);
...@@ -376,10 +379,10 @@ public class FileUtil { ...@@ -376,10 +379,10 @@ public class FileUtil {
int read = 0; int read = 0;
while ( (read = in.read(buf)) != -1) while ( (read = in.read(buf)) != -1)
out.write(buf, 0, read); out.write(buf, 0, read);
out.close(); try { out.close(); } catch (IOException ioe) {}
} finally { } finally {
if (in != null) if (in != null)
in.close(); try { in.close(); } catch (IOException ioe) {}
} }
} }
......
...@@ -111,6 +111,7 @@ public class TunnelHistory { ...@@ -111,6 +111,7 @@ public class TunnelHistory {
_lastFailed = _context.clock().now(); _lastFailed = _context.clock().now();
} }
/***** all unused
public void setLifetimeAgreedTo(long num) { _lifetimeAgreedTo = num; } public void setLifetimeAgreedTo(long num) { _lifetimeAgreedTo = num; }
public void setLifetimeRejected(long num) { _lifetimeRejected = num; } public void setLifetimeRejected(long num) { _lifetimeRejected = num; }
public void setLifetimeFailed(long num) { _lifetimeFailed = num; } public void setLifetimeFailed(long num) { _lifetimeFailed = num; }
...@@ -120,6 +121,7 @@ public class TunnelHistory { ...@@ -120,6 +121,7 @@ public class TunnelHistory {
public void setLastRejectedTransient(long when) { _lastRejectedTransient = when; } public void setLastRejectedTransient(long when) { _lastRejectedTransient = when; }
public void setLastRejectedProbabalistic(long when) { _lastRejectedProbabalistic = when; } public void setLastRejectedProbabalistic(long when) { _lastRejectedProbabalistic = when; }
public void setLastFailed(long when) { _lastFailed = when; } public void setLastFailed(long when) { _lastFailed = when; }
******/
public RateStat getRejectionRate() { return _rejectRate; } public RateStat getRejectionRate() { return _rejectRate; }
public RateStat getFailedRate() { return _failRate; } public RateStat getFailedRate() { return _failRate; }
......
...@@ -18,17 +18,17 @@ import net.i2p.router.TunnelInfo; ...@@ -18,17 +18,17 @@ import net.i2p.router.TunnelInfo;
* *
*/ */
public class TunnelCreatorConfig implements TunnelInfo { public class TunnelCreatorConfig implements TunnelInfo {
protected RouterContext _context; protected final RouterContext _context;
/** only necessary for client tunnels */ /** only necessary for client tunnels */
private Hash _destination; private final Hash _destination;
/** gateway first */ /** gateway first */
private HopConfig _config[]; private final HopConfig _config[];
/** gateway first */ /** gateway first */
private Hash _peers[]; private final Hash _peers[];
private long _expiration; private long _expiration;
private List<Integer> _order; private List<Integer> _order;
private long _replyMessageId; private long _replyMessageId;
private boolean _isInbound; private final boolean _isInbound;
private long _messagesProcessed; private long _messagesProcessed;
private volatile long _verifiedBytesTransferred; private volatile long _verifiedBytesTransferred;
private boolean _failed; private boolean _failed;
...@@ -48,10 +48,6 @@ public class TunnelCreatorConfig implements TunnelInfo { ...@@ -48,10 +48,6 @@ public class TunnelCreatorConfig implements TunnelInfo {
} }
_isInbound = isInbound; _isInbound = isInbound;
_destination = destination; _destination = destination;
_messagesProcessed = 0;
_verifiedBytesTransferred = 0;
_failed = false;
_failures = 0;
} }
/** /**
......
...@@ -26,8 +26,6 @@ class PooledTunnelCreatorConfig extends TunnelCreatorConfig { ...@@ -26,8 +26,6 @@ class PooledTunnelCreatorConfig extends TunnelCreatorConfig {
} }
public PooledTunnelCreatorConfig(RouterContext ctx, int length, boolean isInbound, Hash destination) { public PooledTunnelCreatorConfig(RouterContext ctx, int length, boolean isInbound, Hash destination) {
super(ctx, length, isInbound, destination); super(ctx, length, isInbound, destination);
_pool = null;
_live = false;
} }
// calls TestJob // calls TestJob
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment