Changeset 5055 for pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
- Timestamp:
- Apr 8, 2015 10:10:44 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
r4954 r5055 71 71 { 72 72 pj_dns_resolver *res; 73 pjsip_ext_resolver *ext_res; 73 74 }; 74 75 … … 115 116 } 116 117 118 /* 119 * Public API to set the DNS external resolver implementation for the SIP 120 * resolver. 121 */ 122 PJ_DEF(pj_status_t) pjsip_resolver_set_ext_resolver(pjsip_resolver_t *res, 123 pjsip_ext_resolver *ext_res) 124 { 125 if (ext_res && !ext_res->resolve) 126 return PJ_EINVAL; 127 128 if (ext_res && res->res) { 129 #if PJSIP_HAS_RESOLVER 130 pj_dns_resolver_destroy(res->res, PJ_FALSE); 131 #endif 132 res->res = NULL; 133 } 134 res->ext_res = ext_res; 135 return PJ_SUCCESS; 136 } 137 117 138 118 139 /* … … 175 196 struct query *query; 176 197 pjsip_transport_type_e type = target->type; 198 199 /* If an external implementation has been provided use it instead */ 200 if (resolver->ext_res) { 201 (*resolver->ext_res->resolve)(resolver, pool, target, token, cb); 202 return; 203 } 177 204 178 205 /* Is it IP address or hostname? And if it's an IP, which version? */
Note: See TracChangeset
for help on using the changeset viewer.