plug a tunnel build leak

This commit is contained in:
zzz
2009-02-12 17:10:47 +00:00
parent 806e2f88c8
commit 7b12f700dd

View File

@ -249,6 +249,8 @@ class BuildHandler {
int record = order.indexOf(Integer.valueOf(i)); int record = order.indexOf(Integer.valueOf(i));
if (record < 0) { if (record < 0) {
_log.error("Bad status index " + i); _log.error("Bad status index " + i);
// don't leak
_exec.buildComplete(cfg, cfg.getTunnelPool());
return; return;
} }
int howBad = statuses[record]; int howBad = statuses[record];
@ -294,9 +296,9 @@ class BuildHandler {
_context.messageHistory().tunnelParticipantRejected(peer, "peer rejected after " + rtt + " with " + howBad + ": " + cfg.toString()); _context.messageHistory().tunnelParticipantRejected(peer, "peer rejected after " + rtt + " with " + howBad + ": " + cfg.toString());
} }
} }
_exec.buildComplete(cfg, cfg.getTunnelPool());
if (allAgree) { if (allAgree) {
// wikked, completely build // wikked, completely build
_exec.buildComplete(cfg, cfg.getTunnelPool());
if (cfg.isInbound()) if (cfg.isInbound())
_context.tunnelDispatcher().joinInbound(cfg); _context.tunnelDispatcher().joinInbound(cfg);
else else
@ -313,7 +315,6 @@ class BuildHandler {
_context.statManager().addRateData("tunnel.buildClientSuccess", rtt, rtt); _context.statManager().addRateData("tunnel.buildClientSuccess", rtt, rtt);
} else { } else {
// someone is no fun // someone is no fun
_exec.buildComplete(cfg, cfg.getTunnelPool());
if (cfg.getDestination() == null) if (cfg.getDestination() == null)
_context.statManager().addRateData("tunnel.buildExploratoryReject", rtt, rtt); _context.statManager().addRateData("tunnel.buildExploratoryReject", rtt, rtt);
else else
@ -322,6 +323,8 @@ class BuildHandler {
} else { } else {
if (_log.shouldLog(Log.WARN)) if (_log.shouldLog(Log.WARN))
_log.warn(msg.getUniqueId() + ": Tunnel reply could not be decrypted for tunnel " + cfg); _log.warn(msg.getUniqueId() + ": Tunnel reply could not be decrypted for tunnel " + cfg);
// don't leak
_exec.buildComplete(cfg, cfg.getTunnelPool());
} }
} }