]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_dht/apt_dht.py
ProxyFileStream also calculates hash while downloading.
[quix0rs-apt-p2p.git] / apt_dht / apt_dht.py
index e9b5df30a8928e45cc60ea257676a43ed540c49b..13f2337ee6e00a21a6b212530af8ac57cf5d9f8c 100644 (file)
@@ -1,4 +1,6 @@
 
+from binascii import b2a_hex
+
 from twisted.internet import defer
 from twisted.web2 import server, http, http_headers
 from twisted.python import log
@@ -53,7 +55,7 @@ class AptDHT:
             log.msg('Hash for %s was not found' % path)
             self.download_file([path], hash, size, path, d)
         else:
-            log.msg('Found hash %s for %s' % (hash, path))
+            log.msg('Found hash %s for %s' % (b2a_hex(hash), path))
             # Lookup hash from DHT
             lookupDefer = self.dht.getValue(hash)
             lookupDefer.addCallback(self.lookupHash_done, hash, size, path, d)
@@ -63,7 +65,7 @@ class AptDHT:
             log.msg('Peers for %s were not found' % path)
             self.download_file([path], hash, size, path, d)
         else:
-            log.msg('Found peers for $s: %r' % (path, locations))
+            log.msg('Found peers for %s: %r' % (path, locations))
             # Download from the found peers
             self.download_file(locations, hash, size, path, d)