From: Charles Kerr Date: Fri, 22 Jan 2010 03:39:21 +0000 (+0000) Subject: (trunk libT) if we're calling evdns_init(), we probably ought to call evdns_shutdown... X-Git-Tag: 1.81~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f6214d9aeda0d9c6f4bf6f57dac3c315bf538ff;p=transmission (trunk libT) if we're calling evdns_init(), we probably ought to call evdns_shutdown() on exit... --- diff --git a/libtransmission/trevent.c b/libtransmission/trevent.c index 914d43c13..497929af5 100644 --- a/libtransmission/trevent.c +++ b/libtransmission/trevent.c @@ -19,7 +19,6 @@ #include #include -#include #include "transmission.h" #include "net.h" @@ -220,8 +219,6 @@ libeventThreadFunc( void * veh ) eh->base = event_init( ); eh->session->events = eh; - evdns_init( ); - /* listen to the pipe's read fd */ event_set( &eh->pipeEvent, eh->fds[0], EV_READ | EV_PERSIST, readFromPipe, veh ); diff --git a/libtransmission/web.c b/libtransmission/web.c index 0750c9a72..bc7029caa 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -69,6 +69,7 @@ static void dns_cache_item_free( struct dns_cache_item * ); static void web_free( tr_web * g ) { + evdns_shutdown( TRUE ); curl_multi_cleanup( g->multi ); evtimer_del( &g->timer_event ); tr_list_free( &g->dns_cache, (TrListForeachFunc)dns_cache_item_free ); @@ -586,6 +587,9 @@ tr_webInit( tr_session * session ) evtimer_set( &web->timer_event, libevent_timer_cb, web ); web->multi = curl_multi_init( ); + + evdns_init( ); + curl_multi_setopt( web->multi, CURLMOPT_SOCKETDATA, web ); curl_multi_setopt( web->multi, CURLMOPT_SOCKETFUNCTION, sock_cb ); curl_multi_setopt( web->multi, CURLMOPT_TIMERDATA, web );