From: Cameron Dale Date: Mon, 7 Jan 2008 05:06:48 +0000 (-0800) Subject: Unhexify the returned hashes from the AptPackages lookup. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6bf528fdcd7548348200b934268625d48f0d4b29;p=quix0rs-apt-p2p.git Unhexify the returned hashes from the AptPackages lookup. --- diff --git a/apt_dht/apt_dht.py b/apt_dht/apt_dht.py index e9b5df3..169bf20 100644 --- a/apt_dht/apt_dht.py +++ b/apt_dht/apt_dht.py @@ -1,4 +1,6 @@ +from binascii import a2b_hex + from twisted.internet import defer from twisted.web2 import server, http, http_headers from twisted.python import log @@ -55,7 +57,7 @@ class AptDHT: else: log.msg('Found hash %s for %s' % (hash, path)) # Lookup hash from DHT - lookupDefer = self.dht.getValue(hash) + lookupDefer = self.dht.getValue(a2b_hex(hash)) lookupDefer.addCallback(self.lookupHash_done, hash, size, path, d) def lookupHash_done(self, locations, hash, size, path, d):