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
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
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
Show 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
...
@@ -135,6 +135,9 @@ OPTIONS : VIFIBNET.PY
to :
to :
-h duration -H duration
-h duration -H duration
in babeld ( for more information, see babeld man page )
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
Default : 30
-w, --wireless
-w, --wireless
...
...
TODO
View file @
9e65bddd
...
@@ -49,6 +49,8 @@ To be discussed:
...
@@ -49,6 +49,8 @@ To be discussed:
Btw, is there a doc ( pdf, image, file ) resuming Raphael's stats
Btw, is there a doc ( pdf, image, file ) resuming Raphael's stats
on nexedi's server downtime ? it could be useful for the internship
on nexedi's server downtime ? it could be useful for the internship
rapport
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
G : I think the number of route going through an interface should be a
Connection attribute, not a dict in tunnelManager
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
...
@@ -3,7 +3,6 @@ import argparse, math, random, select, smtplib, sqlite3, string, socket, time, t
from
SimpleXMLRPCServer
import
SimpleXMLRPCServer
,
SimpleXMLRPCRequestHandler
from
SimpleXMLRPCServer
import
SimpleXMLRPCServer
,
SimpleXMLRPCRequestHandler
from
email.mime.text
import
MIMEText
from
email.mime.text
import
MIMEText
from
OpenSSL
import
crypto
from
OpenSSL
import
crypto
from
time
import
time
import
utils
import
utils
# To generate server ca and key with serial for 2001:db8:42::/48
# To generate server ca and key with serial for 2001:db8:42::/48
...
@@ -35,7 +34,7 @@ class main(object):
...
@@ -35,7 +34,7 @@ class main(object):
self
.
cert_duration
=
365
*
86400
self
.
cert_duration
=
365
*
86400
self
.
time_out
=
86400
self
.
time_out
=
86400
self
.
refresh_interval
=
600
self
.
refresh_interval
=
600
self
.
last_refresh
=
time
()
self
.
last_refresh
=
time
.
time
()
# Command line parsing
# Command line parsing
parser
=
argparse
.
ArgumentParser
(
parser
=
argparse
.
ArgumentParser
(
...
@@ -198,10 +197,10 @@ class main(object):
...
@@ -198,10 +197,10 @@ class main(object):
assert
0
<
n
<
1000
assert
0
<
n
<
1000
client_ip
=
utils
.
binFromIp
(
client_address
)
client_ip
=
utils
.
binFromIp
(
client_address
)
if
client_ip
.
startswith
(
self
.
network
):
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"
print
"refreshing peers for dead ones"
self
.
db
.
execute
(
"DELETE FROM peers WHERE ( date + ? ) <= CAST (strftime('%s', 'now') AS INTEGER)"
,
(
self
.
time_out
,))
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"
print
"sending peers"
return
self
.
db
.
execute
(
"SELECT prefix, address FROM peers ORDER BY random() LIMIT ?"
,
(
n
,)).
fetchall
()
return
self
.
db
.
execute
(
"SELECT prefix, address FROM peers ORDER BY random() LIMIT ?"
,
(
n
,)).
fetchall
()
else
:
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