diff options
author | Benny Prijono <bennylp@teluu.com> | 2012-04-26 23:42:27 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2012-04-26 23:42:27 +0000 |
commit | 006bbc00b124af8ccd9b55b531d492657e8daa2b (patch) | |
tree | 1236e26bafbf59ba419522a1a22d50fa8f1fa489 | |
parent | 2b1a4c9031438b38547ffabb7c700324e17837f3 (diff) |
Misc (re #1417): normalize the error status returned by pj_getaddrinfo() to PJ_ERESOLVE, because this error is treated specially to trigger SIP status code 502. This was suspected to have caused pjsip unit test to fail in the regc test
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@4103 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/src/pjsip/sip_resolve.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pjsip/src/pjsip/sip_resolve.c b/pjsip/src/pjsip/sip_resolve.c index c4ef4d61..fb23b538 100644 --- a/pjsip/src/pjsip/sip_resolve.c +++ b/pjsip/src/pjsip/sip_resolve.c @@ -263,8 +263,14 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver, /* Resolve */ count = 1; status = pj_getaddrinfo(af, &target->addr.host, &count, &ai); - if (status != PJ_SUCCESS) + if (status != PJ_SUCCESS) { + /* "Normalize" error to PJ_ERESOLVE. This is a special error + * because it will be translated to SIP status 502 by + * sip_transaction.c + */ + status = PJ_ERESOLVE; goto on_error; + } svr_addr.entry[0].addr.addr.sa_family = (pj_uint16_t)af; pj_memcpy(&svr_addr.entry[0].addr, &ai.ai_addr, |