packages: transmission/transmission.spec, transmission/transmission-timeval...
patrys
patrys at pld-linux.org
Sun Jun 14 18:02:28 CEST 2009
Author: patrys Date: Sun Jun 14 16:02:28 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- port upstream fix to make 0.71 stable
- removed TODO
- rel. 1
---- Files affected:
packages/transmission:
transmission.spec (1.57 -> 1.58) , transmission-timeval.patch (NONE -> 1.1) (NEW), TODO (1.2 -> NONE) (REMOVED)
---- Diffs:
================================================================
Index: packages/transmission/transmission.spec
diff -u packages/transmission/transmission.spec:1.57 packages/transmission/transmission.spec:1.58
--- packages/transmission/transmission.spec:1.57 Wed Jun 10 23:16:28 2009
+++ packages/transmission/transmission.spec Sun Jun 14 18:02:22 2009
@@ -4,7 +4,7 @@
Summary(pl.UTF-8): Wszechstronny i wieloplatformowy klient BitTorrenta
Name: transmission
Version: 1.71
-Release: 0.1
+Release: 1
License: MIT
Group: Applications/Communications
Source0: http://download.m0k.org/transmission/files/%{name}-%{version}.tar.bz2
@@ -12,6 +12,7 @@
Patch0: %{name}-ckb_po.patch
Patch1: %{name}-qtr_details.patch
Patch2: %{name}-preallocate_syscall.patch
+Patch3: %{name}-timeval.patch
URL: http://transmissionbt.com/
BuildRequires: QtGui-devel
BuildRequires: QtNetwork-devel
@@ -101,6 +102,7 @@
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p2
%{__rm} po/ckb.po
%build
@@ -179,6 +181,11 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.58 2009/06/14 16:02:22 patrys
+- port upstream fix to make 0.71 stable
+- removed TODO
+- rel. 1
+
Revision 1.57 2009/06/10 21:16:28 uzsolt
- rel 0.1
- not stable (see TODO)
================================================================
Index: packages/transmission/transmission-timeval.patch
diff -u /dev/null packages/transmission/transmission-timeval.patch:1.1
--- /dev/null Sun Jun 14 18:02:28 2009
+++ packages/transmission/transmission-timeval.patch Sun Jun 14 18:02:22 2009
@@ -0,0 +1,156 @@
+Index: /trunk/libtransmission/utils.c
+===================================================================
+--- /trunk/libtransmission/utils.c (revision 8592)
++++ /trunk/libtransmission/utils.c (revision 8681)
+@@ -458,4 +458,12 @@
+ **/
+
++tr_bool
++tr_isTimeval( const struct timeval * tv )
++{
++ return tv && ( tv->tv_sec >= 0 )
++ && ( tv->tv_usec >= 0 )
++ && ( tv->tv_usec < 1000000 );
++}
++
+ void
+ tr_timevalMsec( uint64_t milliseconds, struct timeval * setme )
+@@ -465,5 +473,19 @@
+ setme->tv_sec = microseconds / 1000000;
+ setme->tv_usec = microseconds % 1000000;
+-}
++ assert( tr_isTimeval( setme ) );
++}
++
++void
++tr_timevalSet( struct timeval * setme, int seconds, int microseconds )
++{
++ setme->tv_sec = seconds;
++ setme->tv_usec = microseconds;
++ assert( tr_isTimeval( setme ) );
++}
++
++
++/**
++***
++**/
+
+ uint8_t *
+Index: /trunk/libtransmission/utils.h
+===================================================================
+--- /trunk/libtransmission/utils.h (revision 8561)
++++ /trunk/libtransmission/utils.h (revision 8681)
+@@ -239,5 +239,9 @@
+ struct timeval;
+
+-void tr_timevalMsec( uint64_t milliseconds, struct timeval * setme );
++tr_bool tr_isTimeval( const struct timeval * tv );
++
++void tr_timevalMsec( uint64_t milliseconds, struct timeval * setme );
++
++void tr_timevalSet( struct timeval * setme, int seconds, int microseconds );
+
+
+Index: /trunk/libtransmission/port-forwarding.c
+===================================================================
+--- /trunk/libtransmission/port-forwarding.c (revision 8538)
++++ /trunk/libtransmission/port-forwarding.c (revision 8681)
+@@ -109,19 +109,19 @@
+ * to renew the port forwarding if it's expired */
+ s->doPortCheck = TRUE;
+- interval.tv_sec = 60*20;
++ tr_timevalSet( &interval, 60*20, 0 );
+ break;
+
+ case TR_PORT_ERROR:
+ /* some kind of an error. wait 60 seconds and retry */
+- interval.tv_sec = 60;
++ tr_timevalSet( &interval, 60, 0 );
+ break;
+
+ default:
+ /* in progress. pulse frequently. */
+- interval.tv_sec = 0;
+- interval.tv_usec = 333000;
++ tr_timevalSet( &interval, 0, 333000 );
+ break;
+ }
+
++ assert( tr_isTimeval( &interval ) );
+ evtimer_add( s->timer, &interval );
+ }
+@@ -144,8 +144,8 @@
+ {
+ struct timeval timeval;
+- timeval.tv_sec = 0;
+- timeval.tv_usec = 333000;
++
+ s->timer = tr_new0( struct event, 1 );
+ evtimer_set( s->timer, onTimer, s );
++ tr_timevalSet( &timeval, 0, 333000 );
+ evtimer_add( s->timer, &timeval );
+ }
+Index: /trunk/libtransmission/tr-dht.c
+===================================================================
+--- /trunk/libtransmission/tr-dht.c (revision 8606)
++++ /trunk/libtransmission/tr-dht.c (revision 8681)
+@@ -92,7 +92,6 @@
+ break;
+ tr_dhtAddNode(cl->session, &addr, port, 1);
+- tv.tv_sec = 2 + tr_cryptoWeakRandInt( 5 );
+- tv.tv_usec = tr_cryptoWeakRandInt( 1000000 );
+- select(0, NULL, NULL, NULL, &tv);
++ tr_timevalSet( &tv, 2 + tr_cryptoWeakRandInt( 5 ), tr_cryptoWeakRandInt( 1000000 ) );
++ select( 0, NULL, NULL, NULL, &tv );
+ }
+ tr_free( cl->nodes );
+@@ -170,7 +169,7 @@
+ }
+
+- tv.tv_sec = 0;
+- tv.tv_usec = tr_cryptoWeakRandInt( 1000000 );
++ tr_timevalSet( &tv, 0, tr_cryptoWeakRandInt( 1000000 ) );
+ event_set( &dht_event, dht_socket, EV_READ, event_callback, NULL );
++ assert( tr_isTimeval( &tv ) );
+ event_add( &dht_event, &tv );
+
+@@ -377,7 +376,6 @@
+ /* Being slightly late is fine,
+ and has the added benefit of adding some jitter. */
+- tv.tv_sec = tosleep;
+- tv.tv_usec = tr_cryptoWeakRandInt( 1000000 );
+- event_add(&dht_event, &tv);
++ tr_timevalSet( &tv, tosleep, tr_cryptoWeakRandInt( 1000000 ) );
++ event_add( &dht_event, &tv );
+ }
+
+Index: /trunk/libtransmission/trevent.c
+===================================================================
+--- /trunk/libtransmission/trevent.c (revision 8662)
++++ /trunk/libtransmission/trevent.c (revision 8681)
+@@ -304,8 +304,10 @@
+ timer->inCallback = 0;
+
+- if( more )
++ if( !more )
++ tr_timerFree( &timer );
++ else {
++ assert( tr_isTimeval( &timer->tv ) );
+ evtimer_add( &timer->event, &timer->tv );
+- else
+- tr_timerFree( &timer );
++ }
+ }
+
+Index: /trunk/libtransmission/session.c
+===================================================================
+--- /trunk/libtransmission/session.c (revision 8680)
++++ /trunk/libtransmission/session.c (revision 8681)
+@@ -1069,6 +1069,5 @@
+
+ tr_localtime_r( &now, &tm );
+- tv.tv_sec = 60 - tm.tm_sec;
+- tv.tv_usec = 0;
++ tr_timevalSet( &tv, 60-tm.tm_sec, 0 );
+ evtimer_add( session->altTimer, &tv );
+ }
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/transmission/transmission.spec?r1=1.57&r2=1.58&f=u
More information about the pld-cvs-commit
mailing list