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
9f503dbb
Commit
9f503dbb
authored
Apr 21, 2018
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
proxy client: loopSignal on put refresh notification
parent
7e447812
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/dht_proxy_client.cpp
+4
-0
4 additions, 0 deletions
src/dht_proxy_client.cpp
with
4 additions
and
0 deletions
src/dht_proxy_client.cpp
+
4
−
0
View file @
9f503dbb
...
@@ -91,6 +91,7 @@ DhtProxyClient::startProxy()
...
@@ -91,6 +91,7 @@ DhtProxyClient::startProxy()
if
(
serverHost_
.
empty
())
return
;
if
(
serverHost_
.
empty
())
return
;
DHT_LOG
.
w
(
"Staring proxy client to %s"
,
serverHost_
.
c_str
());
DHT_LOG
.
w
(
"Staring proxy client to %s"
,
serverHost_
.
c_str
());
nextProxyConfirmation
=
scheduler
.
add
(
scheduler
.
time
(),
std
::
bind
(
&
DhtProxyClient
::
confirmProxy
,
this
));
nextProxyConfirmation
=
scheduler
.
add
(
scheduler
.
time
(),
std
::
bind
(
&
DhtProxyClient
::
confirmProxy
,
this
));
loopSignal_
();
}
}
DhtProxyClient
::~
DhtProxyClient
()
DhtProxyClient
::~
DhtProxyClient
()
...
@@ -647,6 +648,7 @@ DhtProxyClient::cancelListen(const InfoHash& key, size_t gtoken) {
...
@@ -647,6 +648,7 @@ DhtProxyClient::cancelListen(const InfoHash& key, size_t gtoken) {
});
});
}
}
scheduler
.
edit
(
it
->
second
.
opExpirationJob
,
ops
.
getExpiration
());
scheduler
.
edit
(
it
->
second
.
opExpirationJob
,
ops
.
getExpiration
());
loopSignal_
();
return
canceled
;
return
canceled
;
}
}
...
@@ -710,6 +712,7 @@ DhtProxyClient::doListen(const InfoHash& key, ValueCallback cb, Value::Filter fi
...
@@ -710,6 +712,7 @@ DhtProxyClient::doListen(const InfoHash& key, ValueCallback cb, Value::Filter fi
}
}
auto
next
=
l
->
second
.
cache
.
onValues
(
expired
?
new_values_empty
:
values
,
std
::
vector
<
Value
::
Id
>
{},
expired_ids
,
types
,
scheduler
.
time
());
auto
next
=
l
->
second
.
cache
.
onValues
(
expired
?
new_values_empty
:
values
,
std
::
vector
<
Value
::
Id
>
{},
expired_ids
,
types
,
scheduler
.
time
());
scheduler
.
edit
(
l
->
second
.
cacheExpirationJob
,
next
);
scheduler
.
edit
(
l
->
second
.
cacheExpirationJob
,
next
);
loopSignal_
();
return
true
;
return
true
;
};
};
auto
pushNotifToken
=
std
::
make_shared
<
proxy
::
ListenToken
>
(
0
);
auto
pushNotifToken
=
std
::
make_shared
<
proxy
::
ListenToken
>
(
0
);
...
@@ -966,6 +969,7 @@ DhtProxyClient::pushNotificationReceived(const std::map<std::string, std::string
...
@@ -966,6 +969,7 @@ DhtProxyClient::pushNotificationReceived(const std::map<std::string, std::string
auto
vid
=
std
::
stoull
(
vidIt
->
second
);
auto
vid
=
std
::
stoull
(
vidIt
->
second
);
auto
put
=
search
.
puts
.
at
(
vid
);
auto
put
=
search
.
puts
.
at
(
vid
);
scheduler
.
edit
(
put
.
refreshJob
,
scheduler
.
time
());
scheduler
.
edit
(
put
.
refreshJob
,
scheduler
.
time
());
loopSignal_
();
}
else
{
}
else
{
// Refresh listen
// Refresh listen
for
(
auto
&
list
:
search
.
listeners
)
for
(
auto
&
list
:
search
.
listeners
)
...
...
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