Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-kad-dht
Commits
49b95f54
Commit
49b95f54
authored
Mar 07, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added cancel func calls previously ignored
parent
cf59044e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
dht.go
dht.go
+2
-1
No files found.
dht.go
View file @
49b95f54
...
...
@@ -357,11 +357,12 @@ func (dht *IpfsDHT) PingRoutine(t time.Duration) {
rand
.
Read
(
id
)
peers
:=
dht
.
routingTable
.
NearestPeers
(
kb
.
ConvertKey
(
u
.
Key
(
id
)),
5
)
for
_
,
p
:=
range
peers
{
ctx
,
_
:=
context
.
WithTimeout
(
dht
.
Context
(),
time
.
Second
*
5
)
ctx
,
cancel
:=
context
.
WithTimeout
(
dht
.
Context
(),
time
.
Second
*
5
)
_
,
err
:=
dht
.
Ping
(
ctx
,
p
)
if
err
!=
nil
{
log
.
Debugf
(
"Ping error: %s"
,
err
)
}
cancel
()
}
case
<-
dht
.
Closing
()
:
return
...
...
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