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

Mihaly Meszaros misi at niif.hu
Sun Dec 16 13:13:07 CET 2012


Module: sip-router
Branch: misi/dns_srv
Commit: 7ce7d6413b45e7e9df190167e7faba8c10f96492
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7ce7d6413b45e7e9df190167e7faba8c10f96492

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 eddb073..cac0d86 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