catch id validation errors
This commit is contained in:
parent
edb8928f5c
commit
628c46e5d9
|
@ -205,14 +205,14 @@ class KademliaProtocol(protocol.DatagramProtocol):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
msgPrimitive = self._encoder.decode(datagram)
|
msgPrimitive = self._encoder.decode(datagram)
|
||||||
except encoding.DecodeError:
|
message = self._translator.fromPrimitive(msgPrimitive)
|
||||||
|
except (encoding.DecodeError, ValueError):
|
||||||
# We received some rubbish here
|
# We received some rubbish here
|
||||||
return
|
return
|
||||||
except IndexError:
|
except IndexError:
|
||||||
log.warning("Couldn't decode dht datagram from %s", address)
|
log.warning("Couldn't decode dht datagram from %s", address)
|
||||||
return
|
return
|
||||||
|
|
||||||
message = self._translator.fromPrimitive(msgPrimitive)
|
|
||||||
remoteContact = Contact(message.nodeID, address[0], address[1], self)
|
remoteContact = Contact(message.nodeID, address[0], address[1], self)
|
||||||
|
|
||||||
now = time.time()
|
now = time.time()
|
||||||
|
|
Loading…
Reference in a new issue