Commit 09decef5 authored by Simon Morlat's avatar Simon Morlat
Browse files

revert changes made to channel.h/channel.c: they are bogus (a resolver context...

revert changes made to channel.h/channel.c: they are bogus (a resolver context is leaked and can never be cancelled) and useless (nobody uses the function that was added)
parent a95e8f62
......@@ -1253,18 +1253,13 @@ static void channel_res_done(void *data, const char *name, struct addrinfo *ai_l
channel_set_state(obj,BELLE_SIP_CHANNEL_ERROR);
}
}
belle_sip_resolver_context_t * belle_sip_channel_resolve_base(belle_sip_channel_t *obj,belle_sip_resolver_callback_t res_done, const char * peer_name,int peer_port, int ai_family){
belle_sip_resolver_context_t *resolver = NULL;
if (belle_sip_stack_dns_srv_enabled(obj->stack) && obj->lp!=NULL)
resolver=belle_sip_stack_resolve(obj->stack, belle_sip_channel_get_transport_name_lower_case(obj), peer_name, peer_port, ai_family, res_done, obj);
else
obj->resolver_ctx=belle_sip_stack_resolve_a(obj->stack, peer_name, peer_port, ai_family, res_done, obj);
return resolver;
}
void belle_sip_channel_resolve(belle_sip_channel_t *obj){
channel_set_state(obj,BELLE_SIP_CHANNEL_RES_IN_PROGRESS);
obj->resolver_ctx = belle_sip_channel_resolve_base(obj,channel_res_done, obj->peer_name, obj->peer_port, obj->ai_family);
if (belle_sip_stack_dns_srv_enabled(obj->stack) && obj->lp!=NULL)
obj->resolver_ctx=belle_sip_stack_resolve(obj->stack, belle_sip_channel_get_transport_name_lower_case(obj), obj->peer_name, obj->peer_port, obj->ai_family, channel_res_done, obj);
else
obj->resolver_ctx=belle_sip_stack_resolve_a(obj->stack, obj->peer_name, obj->peer_port, obj->ai_family, channel_res_done, obj);
if (obj->resolver_ctx){
belle_sip_object_ref(obj->resolver_ctx);
}
......@@ -1335,10 +1330,6 @@ int belle_sip_channel_queue_message(belle_sip_channel_t *obj, belle_sip_message_
}
void belle_sip_channel_force_close(belle_sip_channel_t *obj){
if (obj->resolver_ctx){
belle_sip_resolver_context_cancel(obj->resolver_ctx);
obj->resolver_ctx = NULL;
}
obj->force_close=1;
channel_set_state(obj,BELLE_SIP_CHANNEL_DISCONNECTED);
}
......
......@@ -137,9 +137,6 @@ int belle_sip_channel_matches(const belle_sip_channel_t *obj, const belle_sip_ho
void belle_sip_channel_resolve(belle_sip_channel_t *obj);
belle_sip_resolver_context_t * belle_sip_channel_resolve_base(belle_sip_channel_t *obj,belle_sip_resolver_callback_t res_done, const char * peer_name,int peer_port, int ai_family);
void belle_sip_channel_connect(belle_sip_channel_t *obj);
void belle_sip_channel_prepare(belle_sip_channel_t *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