Commit 27a5abf6 authored by Guillaume Bury's avatar Guillaume Bury

Added some comments

parent 8d0aabf2
......@@ -15,6 +15,8 @@ To be done :
Write docstrings for all class/methods/functions
Handle corrupt peers DB gracefully
To be discussed:
U : Babel seems to be very long to establish the routes : maybe we should
......
......@@ -188,7 +188,7 @@ class main(object):
else:
prefix, address = self.db.execute("""SELECT prefix, address
FROM peers ORDER BY random() LIMIT 1""")
print "Sending bootstrap peer (%s, %s)" % (prefix, str(address))
print "Sending bootstrap peer (%s, %s)" % (prefix, address)
return prefix, address
def declare(self, handler, address):
......
......@@ -32,9 +32,13 @@ class Connection:
% (self._prefix, self.process.returncode), 3)
return False
self._updateBandwidth()
# self._updateBandwidth()
return True
# Unused for now. By killing tunnels with significantly lower trafic
# in comparison to other tunnels, we hope to connect to nodes with
# better bandwith, in order to improve connectivity with destinations
# we are really interested in.
def _updateBandwidth(self):
try:
f_rx = open('/sys/class/net/%s/statistics/rx_bytes' %
......
......@@ -137,7 +137,7 @@ def main():
# Establish connections
server_process = list(plib.server(internal_ip, len(network) + len(prefix),
config.connection_count, config.dh, write_pipe, port,
proto, config.hello, '--dev', 'vifibnet', *openvpn_args,
proto, config.hello, '--dev', 'vifibnet-%s' % proto, *openvpn_args,
stdout=os.open(os.path.join(config.log,
'vifibnet.server.%s.log' % (proto,)),
os.O_WRONLY | os.O_CREAT | os.O_TRUNC),
......
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