Commit dbc0781b authored by Simon Morlat's avatar Simon Morlat

Fixes resolver_results not providing srv results, and remove trailing '.' at...

Fixes resolver_results not providing srv results, and remove trailing '.' at the end of SRV targets.
parent 1fd910a9
...@@ -97,10 +97,17 @@ belle_sip_dns_srv_t *belle_sip_mdns_srv_create(short unsigned int priority, shor ...@@ -97,10 +97,17 @@ belle_sip_dns_srv_t *belle_sip_mdns_srv_create(short unsigned int priority, shor
belle_sip_dns_srv_t *belle_sip_dns_srv_create(struct dns_srv *srv){ belle_sip_dns_srv_t *belle_sip_dns_srv_create(struct dns_srv *srv){
belle_sip_dns_srv_t *obj=belle_sip_object_new(belle_sip_dns_srv_t); belle_sip_dns_srv_t *obj=belle_sip_object_new(belle_sip_dns_srv_t);
size_t end_pos;
obj->priority=srv->priority; obj->priority=srv->priority;
obj->weight=srv->weight; obj->weight=srv->weight;
obj->port=srv->port; obj->port=srv->port;
obj->target=belle_sip_strdup(srv->target); obj->target=belle_sip_strdup(srv->target);
/*remove trailing '.' at the end*/
end_pos = strlen(obj->target);
if (end_pos > 0){
end_pos--;
if (obj->target[end_pos] == '.') obj->target[end_pos] = '\0';
}
return obj; return obj;
} }
...@@ -1332,10 +1339,8 @@ static void combined_resolver_context_check_finished(belle_sip_combined_resolver ...@@ -1332,10 +1339,8 @@ static void combined_resolver_context_check_finished(belle_sip_combined_resolver
for(elem=obj->srv_results;elem!=NULL;elem=elem->next){ for(elem=obj->srv_results;elem!=NULL;elem=elem->next){
belle_sip_dns_srv_t *srv=(belle_sip_dns_srv_t*)elem->data; belle_sip_dns_srv_t *srv=(belle_sip_dns_srv_t*)elem->data;
final=ai_list_append(final,srv->a_results); final=ai_list_append(final,srv->a_results);
srv->a_results=NULL; srv->dont_free_a_results = TRUE;
} }
belle_sip_list_free_with_data(obj->srv_results,belle_sip_object_unref);
obj->srv_results=NULL;
obj->final_results=final; obj->final_results=final;
belle_sip_resolver_context_notify(BELLE_SIP_RESOLVER_CONTEXT(obj)); belle_sip_resolver_context_notify(BELLE_SIP_RESOLVER_CONTEXT(obj));
} }
......
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