Commit 91578579 authored by Simon Morlat's avatar Simon Morlat
Browse files

fix bug when re-enqueuing http requests on a channel after the original one closed.

parent 09decef5
......@@ -1255,6 +1255,7 @@ static void channel_res_done(void *data, const char *name, struct addrinfo *ai_l
void belle_sip_channel_resolve(belle_sip_channel_t *obj){
belle_sip_message("channel [%p]: starting resolution of %s", obj, obj->peer_name);
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);
......@@ -464,6 +464,11 @@ void belle_http_provider_cancel_request(belle_http_provider_t *obj, belle_http_r
if (req->channel){
// Keep the list of the outgoing messages of the channel...
outgoing_messages = belle_sip_list_copy_with_data(req->channel->outgoing_messages,(void* (*)(void*))belle_sip_object_ref);
if (outgoing_messages->data == req){
/*our request didn't go out; so drop it.*/
outgoing_messages = belle_sip_list_remove(outgoing_messages ,req);
/*protect the channel from being destroyed before removing it (removing it will unref it)*/
provider_remove_channel(obj, req->channel);
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