fix resolv loop

This commit is contained in:
j 2019-01-01 01:44:33 +01:00
parent 7fbc0f7a76
commit 4539792cdc
2 changed files with 4 additions and 3 deletions

View file

@ -155,4 +155,4 @@ class LocalNodes(dict):
def get(self, user_id):
if user_id in self and can_connect(self[user_id]):
return self.get(user_id)
return self[user_id] if user_id in self else None

View file

@ -112,6 +112,8 @@ class Handler(http.server.SimpleHTTPRequestHandler):
return self.do_GET()
def do_GET(self):
#x509 = self.connection.get_peer_certificate()
#user_id = get_service_id(x509.get_pubkey()) if x509 else None
import item.models
parts = self.path.split('/')
if len(parts) == 3 and parts[1] in ('get', 'preview'):
@ -190,8 +192,7 @@ class Handler(http.server.SimpleHTTPRequestHandler):
if not u:
return self._denied()
if u.pending:
logger.debug('ignore request from pending peer[%s] %s (%s)',
user_id, action, args)
logger.debug('ignore request from pending peer[%s]', user_id)
return self._denied()
if not u.peered and u.pending == 'sent':
u.update_peering(True)