[sr-dev] git:master: core/dns: fix an issue when using it without dns cache

Mihaly Meszaros misi at niif.hu
Thu Dec 20 13:43:19 CET 2012


Module: sip-router
Branch: master
Commit: b56e823ed8e7ac2f88d1020677f5e94546a91516
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b56e823ed8e7ac2f88d1020677f5e94546a91516

Author: Mihály Mészáros <misi at niif.hu>
Committer: Mihály Mészáros <misi at niif.hu>
Date:   Sun Dec 16 13:03:18 2012 +0100

core/dns: fix an issue when using it without dns cache

 - fixing an issue what caused that without dns cache we have to use a different function for srv resolution.

---

 resolve.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/resolve.c b/resolve.c
index d37a74e..34d4ff8 100644
--- a/resolve.c
+++ b/resolve.c
@@ -1576,7 +1576,12 @@ struct hostent* no_naptr_srv_sip_resolvehost(str* name, unsigned short* port, ch
 			}
 			srv_name.s=tmp_srv;
 			srv_name.len=len;
-			if ((he=dns_srv_get_he(&srv_name, port, dns_flags))!=0) {
+			#ifdef USE_DNS_CACHE
+			he=dns_srv_get_he(&srv_name, port, dns_flags);
+			#else
+			he=srv_sip_resolvehost(&srv_name, 0, port, proto, 1, 0);
+			#endif
+			if (he!=0) {
 				return he;
 			}
 		}




More information about the sr-dev mailing list