]> granicus.if.org Git - transmission/commitdiff
(trunk libT) if we're calling evdns_init(), we probably ought to call evdns_shutdown...
authorCharles Kerr <charles@transmissionbt.com>
Fri, 22 Jan 2010 03:39:21 +0000 (03:39 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Fri, 22 Jan 2010 03:39:21 +0000 (03:39 +0000)
libtransmission/trevent.c
libtransmission/web.c

index 914d43c1334352f8c86935a0491a6be1d1dd8a16..497929af5281b90a085a6536c04563beb0e27e0a 100644 (file)
@@ -19,7 +19,6 @@
 #include <signal.h>
 
 #include <event.h>
-#include <evdns.h>
 
 #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 );
index 0750c9a722149d9dbd6b213715f6b2417a3e8fea..bc7029caacb5307f7ea071f1cc88e19b315b6e11 100644 (file)
@@ -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 );