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
65c66fd0
Commit
65c66fd0
authored
Feb 14, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix dht command key escaping
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
600c95eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
core/commands/dht.go
core/commands/dht.go
+3
-1
namesys/publisher.go
namesys/publisher.go
+1
-0
No files found.
core/commands/dht.go
View file @
65c66fd0
...
...
@@ -354,6 +354,8 @@ GetValue will return the value stored in the DHT at the given key.
return
}
log
.
Error
(
"RESOLVE KEY: "
,
[]
byte
(
dhtkey
))
go
func
()
{
defer
close
(
outChan
)
for
e
:=
range
events
{
...
...
@@ -573,7 +575,7 @@ func escapeDhtKey(s string) (key.Key, error) {
return
key
.
B58KeyDecode
(
s
),
nil
case
3
:
k
:=
key
.
B58KeyDecode
(
parts
[
2
])
return
key
.
Key
(
path
.
Join
(
append
(
parts
[
:
2
],
k
.
S
tring
()))),
nil
return
key
.
Key
(
path
.
Join
(
append
(
parts
[
:
2
],
s
tring
(
k
)))),
nil
default
:
return
""
,
errors
.
New
(
"invalid key"
)
}
...
...
namesys/publisher.go
View file @
65c66fd0
...
...
@@ -141,6 +141,7 @@ func PutRecordToRouting(ctx context.Context, k ci.PrivKey, value path.Path, seqn
return
err
}
log
.
Error
(
"KEY: "
,
[]
byte
(
namekey
))
ttl
,
ok
:=
checkCtxTTL
(
ctx
)
if
ok
{
entry
.
Ttl
=
proto
.
Uint64
(
uint64
(
ttl
.
Nanoseconds
()))
...
...
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