diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-04-28 04:14:42 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-04-28 04:14:42 +0000 |
commit | 0b1ba733fc4f2645b73a5a9611039b42e8f5cb80 (patch) | |
tree | d164ed9732a405a68c4ce47c9ba987617811d853 /pjnath | |
parent | 0aaf06f5584c93e53a50883a2cd1af5ac2bae416 (diff) |
ICE: prune host candidates (not in ICE)
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/split-3rd-party@1215 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath')
-rw-r--r-- | pjnath/src/pjnath/ice_session.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c index aa83fe24..69cce962 100644 --- a/pjnath/src/pjnath/ice_session.c +++ b/pjnath/src/pjnath/ice_session.c @@ -902,6 +902,10 @@ static pj_status_t prune_checklist(pj_ice_sess *ice, * to the local and remote candidates of a pair higher up on the priority * list */ + /* + * Not in ICE! + * Remove host candidates if their base are the the same! + */ for (i=0; i<clist->count; ++i) { pj_ice_sess_cand *licand = clist->checks[i].lcand; pj_ice_sess_cand *ricand = clist->checks[i].rcand; @@ -910,14 +914,24 @@ static pj_status_t prune_checklist(pj_ice_sess *ice, for (j=i+1; j<clist->count;) { pj_ice_sess_cand *ljcand = clist->checks[j].lcand; pj_ice_sess_cand *rjcand = clist->checks[j].rcand; + const char *reason = NULL; if ((licand == ljcand) && (ricand == rjcand)) { + reason = "duplicate found"; + } else if (sockaddr_cmp(&ljcand->base_addr, + &licand->base_addr)==0) + { + reason = "equal base"; + } + + if (reason != NULL) { /* Found duplicate, remove it */ char buf[CHECK_NAME_LEN]; - LOG5((ice->obj_name, "Check %s pruned", - dump_check(buf, sizeof(buf), &ice->clist, - &clist->checks[j]))); + LOG5((ice->obj_name, "Check %s pruned (%s)", + dump_check(buf, sizeof(buf), &ice->clist, + &clist->checks[j]), + reason)); pj_array_erase(clist->checks, sizeof(clist->checks[0]), clist->count, j); |