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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
ae91f8bd
Commit
ae91f8bd
authored
6 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
dhtrunner: default-initialize tokens
parent
28eeee24
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dhtrunner.cpp
+4
-5
4 additions, 5 deletions
src/dhtrunner.cpp
with
4 additions
and
5 deletions
src/dhtrunner.cpp
+
4
−
5
View file @
ae91f8bd
...
@@ -33,10 +33,10 @@ constexpr std::chrono::seconds DhtRunner::BOOTSTRAP_PERIOD;
...
@@ -33,10 +33,10 @@ constexpr std::chrono::seconds DhtRunner::BOOTSTRAP_PERIOD;
static
constexpr
size_t
RX_QUEUE_MAX_SIZE
=
1024
*
16
;
static
constexpr
size_t
RX_QUEUE_MAX_SIZE
=
1024
*
16
;
struct
DhtRunner
::
Listener
{
struct
DhtRunner
::
Listener
{
size_t
tokenClassicDht
;
size_t
tokenClassicDht
{
0
}
;
size_t
tokenProxyDht
;
size_t
tokenProxyDht
{
0
}
;
ValueCallback
gcb
;
ValueCallback
gcb
;
InfoHash
hash
;
InfoHash
hash
{}
;
Value
::
Filter
f
;
Value
::
Filter
f
;
Where
w
;
Where
w
;
};
};
...
@@ -661,7 +661,7 @@ DhtRunner::listen(InfoHash hash, ValueCallback vcb, Value::Filter f, Where w)
...
@@ -661,7 +661,7 @@ DhtRunner::listen(InfoHash hash, ValueCallback vcb, Value::Filter f, Where w)
pending_ops
.
emplace
([
=
](
SecureDht
&
dht
)
mutable
{
pending_ops
.
emplace
([
=
](
SecureDht
&
dht
)
mutable
{
#ifdef OPENDHT_PROXY_CLIENT
#ifdef OPENDHT_PROXY_CLIENT
auto
tokenbGlobal
=
listener_token_
++
;
auto
tokenbGlobal
=
listener_token_
++
;
L
istener
listener
{}
;
auto
&
l
istener
=
listener
s_
[
tokenbGlobal
]
;
listener
.
hash
=
hash
;
listener
.
hash
=
hash
;
listener
.
f
=
std
::
move
(
f
);
listener
.
f
=
std
::
move
(
f
);
listener
.
w
=
std
::
move
(
w
);
listener
.
w
=
std
::
move
(
w
);
...
@@ -676,7 +676,6 @@ DhtRunner::listen(InfoHash hash, ValueCallback vcb, Value::Filter f, Where w)
...
@@ -676,7 +676,6 @@ DhtRunner::listen(InfoHash hash, ValueCallback vcb, Value::Filter f, Where w)
listener
.
tokenProxyDht
=
dht
.
listen
(
hash
,
listener
.
gcb
,
listener
.
f
,
listener
.
w
);
listener
.
tokenProxyDht
=
dht
.
listen
(
hash
,
listener
.
gcb
,
listener
.
f
,
listener
.
w
);
else
else
listener
.
tokenClassicDht
=
dht
.
listen
(
hash
,
listener
.
gcb
,
listener
.
f
,
listener
.
w
);
listener
.
tokenClassicDht
=
dht
.
listen
(
hash
,
listener
.
gcb
,
listener
.
f
,
listener
.
w
);
listeners_
.
emplace
(
tokenbGlobal
,
std
::
move
(
listener
));
ret_token
->
set_value
(
tokenbGlobal
);
ret_token
->
set_value
(
tokenbGlobal
);
#else
#else
ret_token
->
set_value
(
dht
.
listen
(
hash
,
std
::
move
(
vcb
),
std
::
move
(
f
),
std
::
move
(
w
)));
ret_token
->
set_value
(
dht
.
listen
(
hash
,
std
::
move
(
vcb
),
std
::
move
(
f
),
std
::
move
(
w
)));
...
...
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