/* If all of the pairs in the check list are now either in the Failed or Succeeded state: */ static bool iscompleted(const struct icem *icem) { struct le *le; for (le = icem->checkl.head; le; le = le->next) { const struct candpair *cp = le->data; if (!icem_candpair_iscompleted(cp)) return false; } return true; }
/** * Stop checklist, cancel all connectivity checks * * @param icem ICE Media object * @param err Error code */ void icem_conncheck_stop(struct icem *icem, int err) { struct le *le; icem->state = err ? ICE_CHECKLIST_FAILED : ICE_CHECKLIST_COMPLETED; tmr_cancel(&icem->tmr_pace); for (le = icem->checkl.head; le; le = le->next) { struct ice_candpair *cp = le->data; if (!icem_candpair_iscompleted(cp)) { icem_candpair_cancel(cp); icem_candpair_failed(cp, EINTR, 0); } } icem_checklist_update(icem); }