]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
removed client side connection host determination
authorburris <burris>
Mon, 23 Sep 2002 23:04:49 +0000 (23:04 +0000)
committerburris <burris>
Mon, 23 Sep 2002 23:04:49 +0000 (23:04 +0000)
actions.py
khashmir.py
xmlrpcclient.py

index fe3304a7d577fa30030b2b64dd85c1de6948e216..537181af49e023f0a74fc26bcb2aa04b30042537 100644 (file)
@@ -43,10 +43,7 @@ FIND_NODE_TIMEOUT = 15
 class FindNode(ActionBase):
     """ find node action merits it's own class as it is a long running stateful process """
     def handleGotNodes(self, args):
-       args, conn = args
        l, sender = args
-       if conn['host']:
-           sender['host'] = conn['host']
        sender = Node().initWithDict(sender)
        self.table.table.insertNode(sender)
        if self.finished or self.answered.has_key(sender.id):
@@ -112,10 +109,7 @@ GET_VALUE_TIMEOUT = 15
 class GetValue(FindNode):
     """ get value task """
     def handleGotNodes(self, args):
-       args, conn = args
        l, sender = args
-       if conn['host']:
-           sender['host'] = conn['host']
        sender = Node().initWithDict(sender)
        self.table.table.insertNode(sender)
        if self.finished or self.answered.has_key(sender.id):
index bb78e6ba068969655b69ce78960f70bbb4f256b3..b0325b1f897cb5eef82efacec33ac65d79c48da8 100644 (file)
@@ -155,9 +155,6 @@ class Khashmir(xmlrpc.XMLRPC):
        
            def _notStaleNodeHandler(sender, old=old):
                """ called when we get a pong from the old node """
-               sender, conn = sender
-               if conn['host']:
-                   sender['host'] = conn['host']
                sender = Node().initWithDict(sender)
                if sender.id == old.id:
                    self.table.justSeenNode(old)
index fef7d24ffdaf1fc2e89a090be513e93d1dff564d..cc4d2888b6576843896fda3f89fea4a686a5272a 100644 (file)
@@ -18,21 +18,13 @@ class XMLRPCClient(HTTPClient):
         self.transport.write('\r\n')
        
     def handleResponse(self, buf):
-       try:
-           self.thehost = self.transport.getHost()[1]
-       except:
-           self.thehost = None
        try:
            args, name = loads(buf)
        except Exception, e:
            print "response decode error: " + `e`
            self.d.errback()
        else:
-           l = []
-           for i in args:
-               l.append(i)
-           l.append({'host' : self.thehost})
-           apply(self.d.callback, (l,))
+           apply(self.d.callback, args)
 
 class XMLRPCClientFactory(ClientFactory):
     def __init__(self, method, args, callback=None, errback=None):