This commit is contained in:
Jack Robison 2019-02-01 18:13:45 -05:00
parent c75665d3f0
commit c7cb6822cc
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
4 changed files with 5 additions and 6 deletions

View file

@ -57,7 +57,7 @@ class BlobServerProtocol(asyncio.Protocol):
incoming_blob = {'blob_hash': blob.blob_hash, 'length': blob.length} incoming_blob = {'blob_hash': blob.blob_hash, 'length': blob.length}
responses.append(BlobDownloadResponse(incoming_blob=incoming_blob)) responses.append(BlobDownloadResponse(incoming_blob=incoming_blob))
self.send_response(responses) self.send_response(responses)
log.info("send %s to %s:%i", blob.blob_hash[:8], peer_address, peer_port) log.debug("send %s to %s:%i", blob.blob_hash[:8], peer_address, peer_port)
try: try:
sent = await blob.sendfile(self) sent = await blob.sendfile(self)
except (ConnectionResetError, BrokenPipeError, RuntimeError, OSError): except (ConnectionResetError, BrokenPipeError, RuntimeError, OSError):

View file

@ -79,8 +79,7 @@ class Node:
if not self.protocol.external_ip: if not self.protocol.external_ip:
raise Exception("Cannot determine external IP") raise Exception("Cannot determine external IP")
log.info("Store to %i peers", len(peers)) log.debug("Store to %i peers", len(peers))
log.info(peers)
for peer in peers: for peer in peers:
log.debug("store to %s %s %s", peer.address, peer.udp_port, peer.tcp_port) log.debug("store to %s %s %s", peer.address, peer.udp_port, peer.tcp_port)
stored_to_tup = await asyncio.gather( stored_to_tup = await asyncio.gather(

View file

@ -288,7 +288,7 @@ class IterativeNodeFinder(IterativeFinder):
found = response.found and self.key != self.protocol.node_id found = response.found and self.key != self.protocol.node_id
if found: if found:
log.info("found") log.debug("found")
return self.put_result(self.shortlist, finish=True) return self.put_result(self.shortlist, finish=True)
if self.prev_closest_peer and self.closest_peer and not self._is_closer(self.prev_closest_peer): if self.prev_closest_peer and self.closest_peer and not self._is_closer(self.prev_closest_peer):
# log.info("improving, %i %i %i %i %i", len(self.shortlist), len(self.active), len(self.contacted), # log.info("improving, %i %i %i %i %i", len(self.shortlist), len(self.active), len(self.contacted),
@ -302,7 +302,7 @@ class IterativeNodeFinder(IterativeFinder):
log.info("limit hit") log.info("limit hit")
self.put_result(self.active, True) self.put_result(self.active, True)
elif self.max_results and len(self.active) - len(self.yielded_peers) >= self.max_results: elif self.max_results and len(self.active) - len(self.yielded_peers) >= self.max_results:
log.info("max results") log.debug("max results")
self.put_result(self.active, True) self.put_result(self.active, True)

View file

@ -601,7 +601,7 @@ class KademliaProtocol(DatagramProtocol):
res = await self.get_rpc_peer(peer).store(hash_value) res = await self.get_rpc_peer(peer).store(hash_value)
if res != b"OK": if res != b"OK":
raise ValueError(res) raise ValueError(res)
log.info("Stored %s to %s", binascii.hexlify(hash_value).decode()[:8], peer) log.debug("Stored %s to %s", binascii.hexlify(hash_value).decode()[:8], peer)
return peer.node_id, True return peer.node_id, True
except asyncio.TimeoutError: except asyncio.TimeoutError:
log.debug("Timeout while storing blob_hash %s at %s", binascii.hexlify(hash_value).decode()[:8], peer) log.debug("Timeout while storing blob_hash %s at %s", binascii.hexlify(hash_value).decode()[:8], peer)