Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
805cdbed
Commit
805cdbed
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
python: add biding for missing DhtConfig fields
parent
29efd42d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/opendht.pyx
+14
-1
14 additions, 1 deletion
python/opendht.pyx
python/opendht_cpp.pxd
+12
-0
12 additions, 0 deletions
python/opendht_cpp.pxd
with
26 additions
and
1 deletion
python/opendht.pyx
+
14
−
1
View file @
805cdbed
...
...
@@ -466,7 +466,7 @@ cdef class DhtConfig(object):
cdef
cpp
.
DhtRunnerConfig
_config
def
__init__
(
self
):
self
.
_config
=
cpp
.
DhtRunnerConfig
()
self
.
_config
.
threaded
=
True
;
self
.
_config
.
threaded
=
True
def
setIdentity
(
self
,
Identity
id
):
self
.
_config
.
dht_config
.
id
=
id
.
_id
def
setBootstrapMode
(
self
,
bool
bootstrap
):
...
...
@@ -480,6 +480,19 @@ cdef class DhtConfig(object):
def
setRateLimit
(
self
,
ssize_t
max_req_per_sec
,
ssize_t
max_peer_req_per_sec
):
self
.
_config
.
dht_config
.
node_config
.
max_req_per_sec
=
max_req_per_sec
self
.
_config
.
dht_config
.
node_config
.
max_peer_req_per_sec
=
max_peer_req_per_sec
def
setProxyInfo
(
self
,
str
proxy_server
,
str
push_node_id
=
""
,
str
push_token
=
""
,
str
push_topic
=
""
,
str
push_platform
=
""
,
Certificate
server_ca
=
Certificate
()):
self
.
_config
.
proxy_server
=
proxy_server
.
encode
()
self
.
_config
.
push_node_id
=
push_node_id
.
encode
()
self
.
_config
.
push_token
=
push_token
.
encode
()
self
.
_config
.
push_topic
=
push_topic
.
encode
()
self
.
_config
.
push_platform
=
push_platform
.
encode
()
self
.
_config
.
server_ca
=
server_ca
.
_cert
def
setPeerDiscovery
(
self
,
bool
peer_discovery
,
bool
peer_publish
):
self
.
_config
.
peer_discovery
=
peer_discovery
self
.
_config
.
peer_publish
=
peer_publish
def
setBound
(
self
,
SockAddr
bind4
,
SockAddr
bind6
):
self
.
_config
.
bind4
=
bind4
.
_addr
self
.
_config
.
bind6
=
bind6
.
_addr
cdef
class
DhtRunner
(
_WithID
):
cdef
cpp
.
shared_ptr
[
cpp
.
DhtRunner
]
thisptr
...
...
This diff is collapsed.
Click to expand it.
python/opendht_cpp.pxd
+
12
−
0
View file @
805cdbed
...
...
@@ -239,6 +239,18 @@ cdef extern from "opendht/dhtrunner.h" namespace "dht":
cppclass
Config
:
SecureDhtConfig
dht_config
bool
threaded
string
proxy_server
string
push_node_id
string
push_token
string
push_topic
string
push_platform
bool
peer_discovery
bool
peer_publish
shared_ptr
[
Certificate
]
server_ca
Identity
client_identity
SockAddr
bind4
SockAddr
bind6
InfoHash
getId
()
const
InfoHash
getNodeId
()
const
void
bootstrap
(
const_char
*
,
const_char
*
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment