... possibly causing infinite loops in peerAddFwdServer().
TODO: The condition itself is excessive. If fs is not nil, the previous check
already tells us that the Config.forward_max_tries limit is exceeded.
// due to the allocation method of fs, we must deallocate each manually.
// TODO: use a std::list so we can get the size and abort adding whenever the selection loops reach Config.forward_max_tries
if (fs && psstate->paths->size() >= (unsigned int)Config.forward_max_tries) {
+ assert(fs == psstate->servers);
while (fs) {
- FwdServer *next = fs->next;
+ psstate->servers = fs->next;
cbdataReferenceDone(fs->_peer);
memFree(fs, MEM_FWD_SERVER);
- fs = next;
+ fs = psstate->servers;
}
}