-Upgrade the security in khashmir by using longer TIDs.
-
-The TIDs sent with every request that must be echoed on response are
-very short (one char). They should be lengthened to 20 using the NewID()
-function from khash.
-
-
Hashes of files need to be stored permanently.
A new database of files and their hashes is needed. It should store the
also be used to store info needed to manage the values stored in the DHT.
+Change all print statements to log.msg() calls.
+
+
Add ability to search and hash and DHT-store other directories.
The user should be able to specify a list of directories that will be
from twisted.internet import protocol, reactor
from twisted.trial import unittest
+from khash import newID
+
KRPC_TIMEOUT = 20
KRPC_ERROR = 1
self.addr = addr
self.noisy = spew
self.tids = {}
- self.mtid = 0
self.stopped = False
def datagramReceived(self, str, addr):
raise ProtocolError, "connection has been stopped"
# make message
# send it
- msg = {TID : chr(self.mtid), TYP : REQ, REQ : method, ARG : args}
- self.mtid = (self.mtid + 1) % 256
+ msg = {TID : newID(), TYP : REQ, REQ : method, ARG : args}
if self.noisy:
print self.factory.port, "sending to", self.addr, ":", msg
str = bencode(msg)