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
4
Merge Requests
4
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
2fc3ee74
Commit
2fc3ee74
authored
Aug 09, 2012
by
Ulysse Beaugnon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove some debug print
remove some unecessary info when connecting to the server
parent
0e054578
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
11 deletions
+3
-11
re6st-registry
re6st-registry
+1
-2
re6st/db.py
re6st/db.py
+2
-4
re6st/tunnel.py
re6st/tunnel.py
+0
-5
No files found.
re6st-registry
View file @
2fc3ee74
...
@@ -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
)
...
...
re6st/db.py
View file @
2fc3ee74
...
@@ -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(*)
...
...
re6st/tunnel.py
View file @
2fc3ee74
...
@@ -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
,
...
...
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