diff --git a/src/ice/connchk.c b/src/ice/connchk.c index e9809e688..1bf16d56d 100644 --- a/src/ice/connchk.c +++ b/src/ice/connchk.c @@ -404,6 +404,9 @@ static void rcand_wait_timeout(void *arg) { struct icem *icem = arg; + /* Avoid long startup delay */ + icem->rcand_wait = false; + icem_conncheck_start(icem); } diff --git a/src/ice/icesdp.c b/src/ice/icesdp.c index 90b13940a..e5198cf64 100644 --- a/src/ice/icesdp.c +++ b/src/ice/icesdp.c @@ -239,6 +239,11 @@ static void delayed_rcand(int err, void *arg) if (err) goto out; + if (!rcand->icem->rcand_wait) { + DEBUG_INFO("Late mDNS candidate\n"); + goto out; + } + /* add only if not exist */ if (icem_cand_find(&rcand->icem->rcandl, rcand->cid, &rcand->caddr)) goto out; @@ -247,7 +252,6 @@ static void delayed_rcand(int err, void *arg) &rcand->caddr, &rcand->rel_addr, &rcand->foundation); out: - rcand->icem->rcand_wait = false; mem_deref(rcand); }