提交 0cbbdae1 作者: Jeromy

add in option to use nil-routing

License: MIT
Signed-off-by: 's avatarJeromy <why@ipfs.io>
上级 75cce80b
...@@ -45,6 +45,7 @@ const ( ...@@ -45,6 +45,7 @@ const (
routingOptionSupernodeKwd = "supernode" routingOptionSupernodeKwd = "supernode"
routingOptionDHTClientKwd = "dhtclient" routingOptionDHTClientKwd = "dhtclient"
routingOptionDHTKwd = "dht" routingOptionDHTKwd = "dht"
routingOptionNoneKwd = "none"
unencryptTransportKwd = "disable-transport-encryption" unencryptTransportKwd = "disable-transport-encryption"
unrestrictedApiAccessKwd = "unrestricted-api" unrestrictedApiAccessKwd = "unrestricted-api"
writableKwd = "writable" writableKwd = "writable"
...@@ -331,6 +332,8 @@ func daemonFunc(req cmds.Request, res cmds.Response) { ...@@ -331,6 +332,8 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
ncfg.Routing = core.DHTClientOption ncfg.Routing = core.DHTClientOption
case routingOptionDHTKwd: case routingOptionDHTKwd:
ncfg.Routing = core.DHTOption ncfg.Routing = core.DHTOption
case routingOptionNoneKwd:
ncfg.Routing = core.NilRouterOption
default: default:
res.SetError(fmt.Errorf("unrecognized routing option: %s", routingOption), cmds.ErrNormal) res.SetError(fmt.Errorf("unrecognized routing option: %s", routingOption), cmds.ErrNormal)
return return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论