fix logging error for dht rpc methods with no args (ping)
This commit is contained in:
parent
3096c89e37
commit
fe2d6bad1b
1 changed files with 10 additions and 3 deletions
|
@ -158,7 +158,10 @@ class KademliaProtocol(protocol.DatagramProtocol):
|
|||
msgPrimitive = self._translator.toPrimitive(msg)
|
||||
encodedMsg = self._encoder.encode(msgPrimitive)
|
||||
|
||||
if args:
|
||||
log.debug("DHT SEND CALL %s(%s)", method, args[0].encode('hex'))
|
||||
else:
|
||||
log.debug("DHT SEND CALL %s", method)
|
||||
|
||||
df = defer.Deferred()
|
||||
if rawResponse:
|
||||
|
@ -372,8 +375,12 @@ class KademliaProtocol(protocol.DatagramProtocol):
|
|||
func = getattr(self._node, method, None)
|
||||
if callable(func) and hasattr(func, 'rpcmethod'):
|
||||
# Call the exposed Node method and return the result to the deferred callback chain
|
||||
if args:
|
||||
log.debug("DHT RECV CALL %s(%s) %s:%i", method, args[0].encode('hex'),
|
||||
senderContact.address, senderContact.port)
|
||||
else:
|
||||
log.debug("DHT RECV CALL %s %s:%i", method, senderContact.address,
|
||||
senderContact.port)
|
||||
try:
|
||||
kwargs = {'_rpcNodeID': senderContact.id, '_rpcNodeContact': senderContact}
|
||||
result = func(*args, **kwargs)
|
||||
|
|
Loading…
Reference in a new issue