* BuildHandler: Loop double-check

This commit is contained in:
zzz
2011-03-12 16:08:52 +00:00
parent 46e8add16a
commit cfc17d59b4

View File

@ -418,9 +418,19 @@ class BuildHandler {
if ((!isOutEnd) && _context.routerHash().equals(nextPeer)) {
// We are 2 hops in a row? Drop it without a reply.
// No way to recognize if we are every other hop, but see below
_log.error("Dropping build request where we are in two consecutive hops");
_log.error("Dropping build request, we the next hop");
return;
}
// previous test should be sufficient to keep it from getting here but maybe not?
if (!isInGW) {
Hash from = state.fromHash;
if (from == null)
from = state.from.calculateHash();
if (_context.routerHash().equals(from)) {
_log.error("Dropping build request, we are the previous hop");
return;
}
}
if ((!isOutEnd) && (!isInGW)) {
Hash from = state.fromHash;
if (from == null)