Commit 2fc3ee74 authored by Ulysse Beaugnon's avatar Ulysse Beaugnon

remove some debug print

remove some unecessary info when connecting to the server
parent 0e054578
...@@ -234,7 +234,6 @@ class main(object): ...@@ -234,7 +234,6 @@ class main(object):
def declare(self, handler, address): def declare(self, handler, address):
print "declaring new node" print "declaring new node"
client_address, address = address
client_address, _, _, _ = handler.client_address client_address, _, _, _ = handler.client_address
client_ip = utils.binFromIp(client_address) client_ip = utils.binFromIp(client_address)
if client_ip.startswith(self.network): if client_ip.startswith(self.network):
...@@ -247,7 +246,7 @@ class main(object): ...@@ -247,7 +246,7 @@ class main(object):
% (utils.ipFromBin(client_ip), utils.ipFromBin(self.network.ljust(128, '0')))) % (utils.ipFromBin(client_ip), utils.ipFromBin(self.network.ljust(128, '0'))))
return False return False
def getPeerList(self, handler, n, client_address): def getPeerList(self, handler, n):
assert 0 < n < 1000 assert 0 < n < 1000
client_address, _, _, _ = handler.client_address client_address, _, _, _ = handler.client_address
client_ip = utils.binFromIp(client_address) client_ip = utils.binFromIp(client_address)
......
...@@ -90,16 +90,14 @@ class PeerManager: ...@@ -90,16 +90,14 @@ class PeerManager:
print self._address print self._address
print utils.address_str(self._address) print utils.address_str(self._address)
logging.info('Sending connection info to server...') logging.info('Sending connection info to server...')
self._proxy.declare((self._internal_ip, self._proxy.declare(utils.address_str(self._address))
utils.address_str(self._address)))
logging.debug('Info sent') logging.debug('Info sent')
else: else:
logging.warning("Warning : couldn't send ip, unknown external config") logging.warning("Warning : couldn't send ip, unknown external config")
def _populate(self): def _populate(self):
logging.info('Populating the peers DB...') logging.info('Populating the peers DB...')
new_peer_list = self._proxy.getPeerList(self._db_size, new_peer_list = self._proxy.getPeerList(self._db_size)
self._internal_ip)
with self._db: with self._db:
self._db.execute("""DELETE FROM peers WHERE used <= 0 ORDER BY used, self._db.execute("""DELETE FROM peers WHERE used <= 0 ORDER BY used,
RANDOM() LIMIT MAX(0, ? + (SELECT COUNT(*) RANDOM() LIMIT MAX(0, ? + (SELECT COUNT(*)
......
...@@ -102,11 +102,6 @@ class TunnelManager: ...@@ -102,11 +102,6 @@ class TunnelManager:
self._client_count - len(self._connection_dict)): self._client_count - len(self._connection_dict)):
logging.info('Establishing a connection with %s/%u' % logging.info('Establishing a connection with %s/%u' %
(hex(int(prefix, 2))[2:], len(prefix))) (hex(int(prefix, 2))[2:], len(prefix)))
# DEBUG
print self.free_interface_set
print self._client_count
print self._connection_dict
print len(self._connection_dict)
iface = self.free_interface_set.pop() iface = self.free_interface_set.pop()
self._connection_dict[prefix] = Connection(address, self._connection_dict[prefix] = Connection(address,
self._write_pipe, self._hello, iface, self._write_pipe, self._hello, iface,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment