]> granicus.if.org Git - transmission/commitdiff
(trunk dht) apply patch from jch to increase the number of token_bucket_tokens.
authorJordan Lee <jordan@transmissionbt.com>
Tue, 15 Feb 2011 19:48:57 +0000 (19:48 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Tue, 15 Feb 2011 19:48:57 +0000 (19:48 +0000)
third-party/dht/dht.c

index faa57269ffcf6b63f58c3be28df0aee04b1866ab..03b39e8cae988ad45240982b105dd6ef62b097c8 100644 (file)
@@ -310,7 +310,7 @@ static struct timeval now;
 static time_t mybucket_grow_time, mybucket6_grow_time;
 static time_t expire_stuff_time;
 
-#define MAX_TOKEN_BUCKET_TOKENS 40
+#define MAX_TOKEN_BUCKET_TOKENS 4000
 static time_t token_bucket_time;
 static int token_bucket_tokens;
 
@@ -1714,7 +1714,7 @@ token_bucket(void)
 {
     if(token_bucket_tokens == 0) {
         token_bucket_tokens = MIN(MAX_TOKEN_BUCKET_TOKENS,
-                                  4 * (now.tv_sec - token_bucket_time));
+                                  100 * (now.tv_sec - token_bucket_time));
         token_bucket_time = now.tv_sec;
     }