]> granicus.if.org Git - transmission/commitdiff
#895: tweak
authorCharles Kerr <charles@transmissionbt.com>
Fri, 25 Apr 2008 16:40:14 +0000 (16:40 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Fri, 25 Apr 2008 16:40:14 +0000 (16:40 +0000)
libtransmission/tracker.c

index 671a7f0dbb07250be1e099b7f57978655b3c1bba..91e427055cf266e9122ccbc87814f9c7505a521f 100644 (file)
@@ -721,17 +721,20 @@ invokeRequest( void * vreq )
 
     if( t )
     {
+        const time_t now = time( NULL );
+
         if( req->reqtype == TR_REQ_SCRAPE )
         {
-            t->lastScrapeTime = time( NULL );
+            t->lastScrapeTime = now;
             t->scrapeAt = 0;
         }
         else
         {
-            t->lastAnnounceTime = time( NULL );
+            t->lastAnnounceTime = now;
             t->reannounceAt = 0;
-            t->scrapeAt = 0;
-            t->manualAnnounceAllowedAt = ~(time_t)0;
+            t->scrapeAt = req->reqtype == TR_REQ_STOPPED
+                        ? now + t->scrapeIntervalSec + t->randOffset
+                        : 0;
         }
     }