fix resolv loop
This commit is contained in:
parent
7fbc0f7a76
commit
4539792cdc
2 changed files with 4 additions and 3 deletions
|
@ -155,4 +155,4 @@ class LocalNodes(dict):
|
||||||
|
|
||||||
def get(self, user_id):
|
def get(self, user_id):
|
||||||
if user_id in self and can_connect(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
|
||||||
|
|
|
@ -112,6 +112,8 @@ class Handler(http.server.SimpleHTTPRequestHandler):
|
||||||
return self.do_GET()
|
return self.do_GET()
|
||||||
|
|
||||||
def do_GET(self):
|
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
|
import item.models
|
||||||
parts = self.path.split('/')
|
parts = self.path.split('/')
|
||||||
if len(parts) == 3 and parts[1] in ('get', 'preview'):
|
if len(parts) == 3 and parts[1] in ('get', 'preview'):
|
||||||
|
@ -190,8 +192,7 @@ class Handler(http.server.SimpleHTTPRequestHandler):
|
||||||
if not u:
|
if not u:
|
||||||
return self._denied()
|
return self._denied()
|
||||||
if u.pending:
|
if u.pending:
|
||||||
logger.debug('ignore request from pending peer[%s] %s (%s)',
|
logger.debug('ignore request from pending peer[%s]', user_id)
|
||||||
user_id, action, args)
|
|
||||||
return self._denied()
|
return self._denied()
|
||||||
if not u.peered and u.pending == 'sent':
|
if not u.peered and u.pending == 'sent':
|
||||||
u.update_peering(True)
|
u.update_peering(True)
|
||||||
|
|
Loading…
Reference in a new issue