]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
fixed nonresponsive node handler
authorburris <burris>
Sat, 14 Sep 2002 00:19:10 +0000 (00:19 +0000)
committerburris <burris>
Sat, 14 Sep 2002 00:19:10 +0000 (00:19 +0000)
actions.py
khashmir.py
xmlrpcclient.py

index 77160d7669b3e5e1a2b0bd97ce26a29c47dbb38b..0a6062f0ee136f21a35af19e29d0b07ed1bdbb93 100644 (file)
@@ -173,7 +173,8 @@ class GetValue(FindNode):
            self.found[node.id] = node
            #xxx t.timeout = time.time() + FIND_NODE_TIMEOUT
            df = node.findValue(self.target, self.table.node.senderDict())
-           df.addCallbacks(self.handleGotNodes, self.defaultGotNodes)
+           df.addCallback(self.handleGotNodes)
+           df.addErrback(self.defaultGotNodes)
            self.outstanding = self.outstanding + 1
            self.queried[node.id] = 1
        if self.outstanding == 0:
@@ -226,6 +227,8 @@ class KeyExpirer:
                    self.store.delete(h)
                    ic.delete()
                    i = i + 1
+               else:
+                   break
            irec = f()
            
        reactor.callLater(KE_DELAY, self.doExpire)
index 509725bdfcd8ffe3563e3e2efd50359201d9f5a2..8ef62211501bfd06e38c83339b6c93b7255e0a48 100644 (file)
@@ -209,7 +209,6 @@ class Khashmir(xmlrpc.XMLRPC):
                v = loads(self.store[h1])[1]
                l.append(v)
                tup = c.next()
-           l = map(lambda v: Binary(v), l)
            return l
        return []
        
@@ -265,7 +264,8 @@ class Khashmir(xmlrpc.XMLRPC):
        self.insertNode(n)
 
        l = self.retrieveValues(key)
-       if len(l):
+       if len(l) > 0:
+           l = map(lambda v: Binary(v), l)
            return {'values' : l}, self.node.senderDict()
        else:
            nodes = self.table.findNodes(key)
index 5c8f3cf2565329cc235cf9f598e296c86eb3abd4..8e4cc6957c5d32409f604c0aa3dfdeb860abc5dc 100644 (file)
@@ -41,3 +41,6 @@ class XMLRPCClientFactory(ClientFactory):
        prot.args = self.args
        prot.d = self.d
        return prot
+
+    def clientConnectionFailed(self, connector, reason):
+       self.d.errback()
\ No newline at end of file