X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=const.py;h=58d539ec56ea1723b1a90be03786958fb2fa014c;hb=cc191e1f1a6b78e15cbf13def1d933cc817a13e3;hp=797b2d0ce84adea331ca512b7a82d57d66c45159;hpb=4310c7b8d0f5ba7795b3b4ed6f918329f9b710c0;p=quix0rs-apt-p2p.git diff --git a/const.py b/const.py index 797b2d0..58d539e 100644 --- a/const.py +++ b/const.py @@ -1,6 +1,10 @@ +## Copyright 2002-2003 Andrew Loewenstern, All Rights Reserved +# see LICENSE.txt for license information + +""" from twisted.internet.default import SelectReactor ## twistedmatrix.com -reactor = SelectReactor(installSignalHandlers=0) +reactor = SelectReactor() from twisted.internet import main main.installReactor(reactor) @@ -11,12 +15,13 @@ try: reactor.installResolver(twisted.names.client.theResolver) except IOError: print "no resolv.conf!" +""" # magic id to use before we know a peer's id NULL_ID = 20 * '\0' # Kademlia "K" constant, this should be an even number -K = 20 +K = 8 # SHA1 is 160 bits long HASH_LENGTH = 160 @@ -41,7 +46,7 @@ MAX_FAILURES = 3 MIN_PING_INTERVAL = 60 * 15 # fifteen minutes # refresh buckets that haven't been touched in this long -BUCKET_STALENESS = 60 # one hour +BUCKET_STALENESS = 60 * 60 # one hour ### KEY EXPIRER @@ -49,7 +54,7 @@ BUCKET_STALENESS = 60 # one hour KEINITIAL_DELAY = 15 # 15 seconds - to clean out old stuff in persistent db # time between expirer runs -KE_DELAY = 60 * 60 # 1 hour +KE_DELAY = 60 * 20 # 20 minutes # expire entries older than this -KE_AGE = 60 * 60 * 24 # 24 hours +KE_AGE = 60 * 60 # 60 minutes