]> granicus.if.org Git - transmission/commitdiff
Update tr-utp.c to be compatible with libevent2.
authorJuliusz Chroboczek <jch@pps.univ-paris-diderot.fr>
Fri, 18 Feb 2011 00:24:11 +0000 (00:24 +0000)
committerJuliusz Chroboczek <jch@pps.univ-paris-diderot.fr>
Fri, 18 Feb 2011 00:24:11 +0000 (00:24 +0000)
libtransmission/tr-utp.c

index af557408a21479edd7ba9619d2a3529af3a0e50d..9a74c710d03b1a235a0226d795bf219d17ea622e 100644 (file)
@@ -96,12 +96,12 @@ tr_utpPacket(const unsigned char *buf, size_t buflen,
              tr_session *ss)
 {
     if(utp_timer == NULL) {
-        utp_timer = tr_new0(struct event, 1);
+        utp_timer = evtimer_new( ss->event_base, timer_callback, NULL);
         if(utp_timer == NULL)
             return -1;
-        evtimer_set(utp_timer, timer_callback, NULL);
         tr_timerAdd(utp_timer, 0,
-                    UTP_INTERVAL_US / 2 + tr_cryptoWeakRandInt(UTP_INTERVAL_US));
+                    UTP_INTERVAL_US / 2 +
+                    tr_cryptoWeakRandInt(UTP_INTERVAL_US));
     }
 
     return UTP_IsIncomingUTP(incoming, send_to, ss,