27 lines
1.0 KiB
Diff
27 lines
1.0 KiB
Diff
|
--- src/belle_sip_resolver.c 2018-02-21 17:30:40.474348393 +0100
|
||
|
+++ - 2018-02-21 17:32:31.892044464 +0100
|
||
|
@@ -459,7 +459,11 @@
|
||
|
}
|
||
|
|
||
|
static void append_dns_result(belle_sip_simple_resolver_context_t *ctx, struct addrinfo **ai_list, struct sockaddr *addr, socklen_t addrlen){
|
||
|
+#if defined(__GLIBC__)
|
||
|
char host[NI_MAXHOST + 1];
|
||
|
+#else
|
||
|
+ char host[1026];
|
||
|
+#endif
|
||
|
int gai_err;
|
||
|
int family=ctx->family;
|
||
|
|
||
|
@@ -529,7 +533,11 @@
|
||
|
append_dns_result(ctx,&ctx->ai_list,(struct sockaddr*)&sin,sizeof(sin));
|
||
|
if (rr.ttl < BELLE_SIP_RESOLVER_CONTEXT(ctx)->min_ttl) BELLE_SIP_RESOLVER_CONTEXT(ctx)->min_ttl = rr.ttl;
|
||
|
} else if ((ctx->type == DNS_T_SRV) && (rr.class == DNS_C_IN) && (rr.type == DNS_T_SRV)) {
|
||
|
+#if defined(__GLIBC__)
|
||
|
char host[NI_MAXHOST + 1];
|
||
|
+#else
|
||
|
+ char host[1026];
|
||
|
+#endif
|
||
|
struct dns_srv *srv = &any.srv;
|
||
|
belle_sip_dns_srv_t * b_srv=belle_sip_dns_srv_create(srv);
|
||
|
snprintf(host, sizeof(host), "[target:%s port:%d prio:%d weight:%d]", srv->target, srv->port, srv->priority, srv->weight);
|