]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
fix bug in pong handler
authorburris <burris>
Fri, 13 Sep 2002 20:13:31 +0000 (20:13 +0000)
committerburris <burris>
Fri, 13 Sep 2002 20:13:31 +0000 (20:13 +0000)
khashmir.py

index 27c29281eced0bc437748a9e4942f83bbd55958c..8321cf7ce08d3d83a22c92c2e343871e2176ec6b 100644 (file)
@@ -140,7 +140,8 @@ class Khashmir(xmlrpc.XMLRPC):
        
            def _notStaleNodeHandler(sender, old=old):
                """ called when we get a ping from the remote node """
-               if sender['id'] == old.id:
+               sender = Node().initWithSenderDict(sender)
+               if sender.id == old.id:
                    self.table.insertNode(old)
 
            df = old.ping(self.node.senderDict())
@@ -154,7 +155,8 @@ class Khashmir(xmlrpc.XMLRPC):
        df = node.ping(self.node.senderDict())
        ## these are the callbacks we use when we issue a PING
        def _pongHandler(sender, id=node.id, host=node.host, port=node.port, table=self.table):
-           if id != 20 * ' ' and id != sender['id']:
+           sender = Node().initWithSenderDict(sender)
+           if id != 20 * ' ' and id != sender.id:
                # whoah, got response from different peer than we were expecting
                pass
            else: