From: burris Date: Mon, 23 Sep 2002 23:04:49 +0000 (+0000) Subject: removed client side connection host determination X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a4d13efc19e57321ef61886d15e407f6f1b91048;p=quix0rs-apt-p2p.git removed client side connection host determination --- diff --git a/actions.py b/actions.py index fe3304a..537181a 100644 --- a/actions.py +++ b/actions.py @@ -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): diff --git a/khashmir.py b/khashmir.py index bb78e6b..b0325b1 100644 --- a/khashmir.py +++ b/khashmir.py @@ -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) diff --git a/xmlrpcclient.py b/xmlrpcclient.py index fef7d24..cc4d288 100644 --- a/xmlrpcclient.py +++ b/xmlrpcclient.py @@ -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):