Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
re6stnet
Commits
9e65bddd
Commit
9e65bddd
authored
Jul 23, 2012
by
Guillaume Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix in the refresh dead peers in registry + added info about hello interval
parent
4e4830ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
README
README
+3
-0
TODO
TODO
+2
-0
registry.py
registry.py
+3
-4
No files found.
README
View file @
9e65bddd
...
...
@@ -135,6 +135,9 @@ OPTIONS : VIFIBNET.PY
to :
-h duration -H duration
in babeld ( for more information, see babeld man page )
It takes between 3 times and 4 times the hello interval for babel
to re-establish connection with a node for which the direct
connection has been cut
Default : 30
-w, --wireless
...
...
TODO
View file @
9e65bddd
...
...
@@ -49,6 +49,8 @@ To be discussed:
Btw, is there a doc ( pdf, image, file ) resuming Raphael's stats
on nexedi's server downtime ? it could be useful for the internship
rapport
==> It takes babel between 3 times and 4 times the hello interval to
reestablish connection, if a direct link is cut
G : I think the number of route going through an interface should be a
Connection attribute, not a dict in tunnelManager
...
...
registry.py
View file @
9e65bddd
...
...
@@ -3,7 +3,6 @@ import argparse, math, random, select, smtplib, sqlite3, string, socket, time, t
from
SimpleXMLRPCServer
import
SimpleXMLRPCServer
,
SimpleXMLRPCRequestHandler
from
email.mime.text
import
MIMEText
from
OpenSSL
import
crypto
from
time
import
time
import
utils
# To generate server ca and key with serial for 2001:db8:42::/48
...
...
@@ -35,7 +34,7 @@ class main(object):
self
.
cert_duration
=
365
*
86400
self
.
time_out
=
86400
self
.
refresh_interval
=
600
self
.
last_refresh
=
time
()
self
.
last_refresh
=
time
.
time
()
# Command line parsing
parser
=
argparse
.
ArgumentParser
(
...
...
@@ -198,10 +197,10 @@ class main(object):
assert
0
<
n
<
1000
client_ip
=
utils
.
binFromIp
(
client_address
)
if
client_ip
.
startswith
(
self
.
network
):
if
time
()
>
self
.
last_refresh
+
self
.
refresh_interval
:
if
time
.
time
()
>
self
.
last_refresh
+
self
.
refresh_interval
:
print
"refreshing peers for dead ones"
self
.
db
.
execute
(
"DELETE FROM peers WHERE ( date + ? ) <= CAST (strftime('%s', 'now') AS INTEGER)"
,
(
self
.
time_out
,))
self
.
last_refesh
=
time
()
self
.
last_refesh
=
time
.
time
()
print
"sending peers"
return
self
.
db
.
execute
(
"SELECT prefix, address FROM peers ORDER BY random() LIMIT ?"
,
(
n
,)).
fetchall
()
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment