In the function
void P2PSocket::RememberRemoteCandidate()
uint32 i = 0;
while (i < remote_candidates_.size()) {
if (remote_candidates_[i].generation() < remote_candidate.generation()) {
remote_candidates_.erase(remote_candidates_.begin() + i);
LOG(INFO) << "Pruning candidate from old generation: "
<< remote_candidates_[i].address().ToString();
} else {
i += 1;
}
}
This Code does not log the correct candidate.
This can lead to further problems if the list remote_candidates_ does not contain more candidates.
FIX: Log before the element is removed