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
dms3
go-dms3
Commits
c070c2f0
Commit
c070c2f0
authored
Oct 20, 2014
by
Jeromy
Committed by
Juan Batiz-Benet
Oct 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working on debugging dht issues
parent
2f345c85
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
routing/dht/dht.go
routing/dht/dht.go
+1
-1
routing/dht/handlers.go
routing/dht/handlers.go
+6
-3
No files found.
routing/dht/dht.go
View file @
c070c2f0
...
...
@@ -272,7 +272,7 @@ func (dht *IpfsDHT) getValueOrPeers(ctx context.Context, p peer.Peer,
// Perhaps we were given closer peers
var
peers
[]
peer
.
Peer
for
_
,
pb
:=
range
pmes
.
GetCloserPeers
()
{
pr
,
err
:=
dht
.
add
Peer
(
pb
)
pr
,
err
:=
dht
.
ensureConnectedTo
Peer
(
pb
)
if
err
!=
nil
{
log
.
Error
(
"%s"
,
err
)
continue
...
...
routing/dht/handlers.go
View file @
c070c2f0
...
...
@@ -48,10 +48,10 @@ func (dht *IpfsDHT) handleGetValue(p peer.Peer, pmes *Message) (*Message, error)
}
// let's first check if we have the value locally.
log
.
Debug
(
"%s handleGetValue looking into ds
\n
"
,
dht
.
self
)
log
.
Debug
(
"%s handleGetValue looking into ds"
,
dht
.
self
)
dskey
:=
u
.
Key
(
pmes
.
GetKey
())
.
DsKey
()
iVal
,
err
:=
dht
.
datastore
.
Get
(
dskey
)
log
.
Debug
(
"%s handleGetValue looking into ds GOT %v
\n
"
,
dht
.
self
,
iVal
)
log
.
Debug
(
"%s handleGetValue looking into ds GOT %v"
,
dht
.
self
,
iVal
)
// if we got an unexpected error, bail.
if
err
!=
nil
&&
err
!=
ds
.
ErrNotFound
{
...
...
@@ -63,7 +63,7 @@ func (dht *IpfsDHT) handleGetValue(p peer.Peer, pmes *Message) (*Message, error)
// if we have the value, send it back
if
err
==
nil
{
log
.
Debug
(
"%s handleGetValue success!
\n
"
,
dht
.
self
)
log
.
Debug
(
"%s handleGetValue success!"
,
dht
.
self
)
byts
,
ok
:=
iVal
.
([]
byte
)
if
!
ok
{
...
...
@@ -85,6 +85,9 @@ func (dht *IpfsDHT) handleGetValue(p peer.Peer, pmes *Message) (*Message, error)
if
closer
!=
nil
{
for
_
,
p
:=
range
closer
{
log
.
Debug
(
"handleGetValue returning closer peer: '%s'"
,
p
)
if
len
(
p
.
Addresses
())
<
1
{
log
.
Error
(
"no addresses on peer being sent!"
)
}
}
resp
.
CloserPeers
=
peersToPBPeers
(
closer
)
}
...
...
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