提交 e66e8bbe 作者: Łukasz Magiera

Corenet API: Review fixes

License: MIT
Signed-off-by: 's avatarŁukasz Magiera <magik6k@gmail.com>
上级 e0bd4a11
......@@ -465,7 +465,7 @@ var corenetCloseCmd = &cmds.Command{
useHandlerID := false
if !closeAll && len(req.Arguments()) == 0 {
res.SetError(errors.New(" handlerID nor stream protocol"), cmds.ErrNormal)
res.SetError(errors.New("no handlerID nor stream protocol specified"), cmds.ErrNormal)
return
} else if !closeAll {
......@@ -479,11 +479,11 @@ var corenetCloseCmd = &cmds.Command{
}
if closeAll || useHandlerID {
for _, s := range n.Corenet.Streams.Streams {
if !closeAll && handlerID != s.HandlerID {
for _, stream := range n.Corenet.Streams.Streams {
if !closeAll && handlerID != stream.HandlerID {
continue
}
s.Close()
stream.Close()
if !closeAll {
break
}
......@@ -491,19 +491,16 @@ var corenetCloseCmd = &cmds.Command{
}
if closeAll || !useHandlerID {
for _, a := range n.Corenet.Apps.Apps {
if !closeAll && a.Protocol != proto {
for _, app := range n.Corenet.Apps.Apps {
if !closeAll && app.Protocol != proto {
continue
}
a.Close()
app.Close()
if !closeAll {
break
}
}
}
if len(req.Arguments()) != 1 {
}
},
}
......
......@@ -47,7 +47,7 @@ ADVANCED COMMANDS
pin Pin objects to local storage
repo Manipulate the IPFS repository
stats Various operational stats
exp Experimental commands
corenet Libp2p stream mounting
filestore Manage the filestore (experimental)
NETWORK COMMANDS
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论