From 1ef888f9f17267294c473fd8f63b78b90b3120a4 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sun, 9 Jan 2011 23:14:17 +0000 Subject: [PATCH] Fix incorrect usage of event_new in UDP code. Apparently you need to pass session->event_base as the first argument. --- libtransmission/tr-dht.c | 2 +- libtransmission/tr-udp.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libtransmission/tr-dht.c b/libtransmission/tr-dht.c index 24a19a0ef..8cd6c1d8c 100644 --- a/libtransmission/tr-dht.c +++ b/libtransmission/tr-dht.c @@ -315,7 +315,7 @@ tr_dhtInit(tr_session *ss) cl->len6 = len6; tr_threadNew( dht_bootstrap, cl ); - dht_timer = evtimer_new( NULL, timer_callback, session ); + dht_timer = evtimer_new( session->event_base, timer_callback, session ); tr_timerAdd( dht_timer, 0, tr_cryptoWeakRandInt( 1000000 ) ); tr_ndbg( "DHT", "DHT initialized" ); diff --git a/libtransmission/tr-udp.c b/libtransmission/tr-udp.c index 70a54770a..ab56b81c4 100644 --- a/libtransmission/tr-udp.c +++ b/libtransmission/tr-udp.c @@ -172,7 +172,7 @@ tr_udpInit(tr_session *ss, const tr_address * addr) goto ipv6; } ss->udp_event = - event_new(NULL, ss->udp_socket, EV_READ | EV_PERSIST, + event_new(ss->event_base, ss->udp_socket, EV_READ | EV_PERSIST, event_callback, ss); if( ss->udp_event == NULL ) tr_nerr("UDP", "Couldn't allocate IPv4 event"); @@ -182,7 +182,7 @@ tr_udpInit(tr_session *ss, const tr_address * addr) rebind_ipv6(ss, TRUE); if(ss->udp6_socket >= 0) { ss->udp6_event = - event_new(NULL, ss->udp6_socket, EV_READ | EV_PERSIST, + event_new(ss->event_base, ss->udp6_socket, EV_READ | EV_PERSIST, event_callback, ss); if(ss->udp6_event == NULL) tr_nerr("UDP", "Couldn't allocate IPv6 event");