Commit ecfff5f6 authored by jehan's avatar jehan
Browse files

set priority to hosts,dns in case of HAVE_RESINIT

parent c82f5ff9
......@@ -19,13 +19,16 @@
#include "belle_sip_resolver.h"
#include <stdlib.h>
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
#define DNS_EAGAIN EAGAIN
static struct dns_resolv_conf *resconf(belle_sip_resolver_context_t *ctx) {
#if !_WIN32 && !HAVE_RESINIT
/*#if !_WIN32 && (!HAVE_RESINIT || !TARGET_OS_IPHONE)*/
const char *path;
#endif
int error;
......@@ -49,6 +52,7 @@ static struct dns_resolv_conf *resconf(belle_sip_resolver_context_t *ctx) {
belle_sip_error("%s dns_resconf_loadandroid error", __FUNCTION__);
}
#elif HAVE_RESINIT
/*#elif HAVE_RESINIT && TARGET_OS_IPHONE*/
error = dns_resconf_loadfromresolv(ctx->resconf);
if (error) {
belle_sip_error("%s dns_resconf_loadfromresolv error", __FUNCTION__);
......
......@@ -4388,6 +4388,7 @@ int dns_resconf_loadfromresolv(struct dns_resolv_conf *resconf) {
memcpy(&resconf->nameserver[i],&addresses[i],sizeof(union res_sockaddr_union));
}
res_ndestroy(&res);
strncpy(resconf->lookup, "fcb", sizeof resconf->lookup);
return i>0?0:-1;
}
#endif /*HAVE_RESINIT*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment