fix(connlib): don't add host candidates multiple times (#7172)

We introduced a boolean bug in #7163 that causes us to attempt to add
host candidates much more often than necessary. This spams the logs on
DEBUG level but was otherwise not harmful.
This commit is contained in:
Thomas Eizinger
2024-10-30 02:13:40 +11:00
committed by GitHub
parent f7a388345b
commit 1d9802f2e4

View File

@@ -744,7 +744,7 @@ where
fn add_local_as_host_candidate(&mut self, local: SocketAddr) -> Result<(), Error> {
let host_candidate = Candidate::host(local, Protocol::Udp)?;
if self.shared_candidates.insert(host_candidate.clone()) {
if !self.shared_candidates.insert(host_candidate.clone()) {
return Ok(());
}