getFirstUpParent() could return a down (or otherwise disqualified)
cache_peer. Broken by 2023 commit
2e24d0b.
Refactored function structure to improve code quality, partially
addressing "use our return/reporting style" TODO in getDefaultParent().
assert(ps);
HttpRequest *request = ps->request;
- CachePeer *p = nullptr;
-
for (const auto &peer: CurrentCachePeers()) {
- p = peer.get();
+ const auto p = peer.get();
if (!neighborUp(p))
continue;
if (!peerHTTPOkay(p, ps))
continue;
- break;
+ debugs(15, 3, "returning " << *p);
+ return p;
}
- debugs(15, 3, "returning " << RawPointer(p).orNil());
- return p;
+ debugs(15, 3, "none found");
+ return nullptr;
}
CachePeer *