Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit 0ec8e8d

Browse filesBrowse files
committed
bugfix: delete the default value for supernodes from dfdaemon
Signed-off-by: Starnop <starnopg@gmail.com>
1 parent 6bc6db4 commit 0ec8e8d
Copy full SHA for 0ec8e8d

File tree

Expand file treeCollapse file tree

3 files changed

+6
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-4
lines changed
Open diff view settings
Collapse file

‎cmd/dfdaemon/app/root.go‎

Copy file name to clipboardExpand all lines: cmd/dfdaemon/app/root.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func init() {
9595
rf.String("localrepo", filepath.Join(os.Getenv("HOME"), ".small-dragonfly/dfdaemon/data/"), "temp output dir of dfdaemon")
9696
rf.String("dfpath", defaultDfgetPath, "dfget path")
9797
rf.Var(netutils.NetLimit(), "ratelimit", "net speed limit")
98-
rf.StringSlice("node", []string{"127.0.0.1:8002"}, "specify the addresses(host:port) of supernodes that will be passed to dfget.")
98+
rf.StringSlice("node", nil, "specify the addresses(host:port) of supernodes that will be passed to dfget.")
9999

100100
exitOnError(bindRootFlags(viper.GetViper()), "bind root command flags")
101101
}
Collapse file

‎cmd/dfdaemon/app/root_test.go‎

Copy file name to clipboardExpand all lines: cmd/dfdaemon/app/root_test.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (ts *rootTestSuite) TestNodeFlag() {
7676
r.Equal([]string{"127.0.0.1:6666"}, cfg.SuperNodes)
7777
}
7878

79-
// flag not set, config file doesn't exist, should use default
79+
// flag not set, config file doesn't exist, should be nil
8080
{
8181
v := viper.New()
8282
v.SetFs(fs)
@@ -86,7 +86,7 @@ func (ts *rootTestSuite) TestNodeFlag() {
8686
r.NotNil(readConfigFile(v, rootCmd))
8787
cfg, err := getConfigFromViper(rootCmd, v)
8888
r.Nil(err)
89-
r.Equal([]string{"127.0.0.1:8002"}, cfg.SuperNodes)
89+
r.EqualValues([]string(nil), cfg.SuperNodes)
9090
}
9191

9292
// when --node flag is set, should always use the flag
Collapse file

‎dfdaemon/downloader/dfget/dfget.go‎

Copy file name to clipboardExpand all lines: dfdaemon/downloader/dfget/dfget.go
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ func (dfGetter *DFGetter) getCommand(
7777
}
7878
add("-s", dfGetter.config.RateLimit)
7979
add("--totallimit", dfGetter.config.RateLimit)
80-
add("--node", strings.Join(dfGetter.config.SuperNodes, ","))
80+
if len(dfGetter.config.SuperNodes) > 0 {
81+
add("--node", strings.Join(dfGetter.config.SuperNodes, ","))
82+
}
8183

8284
for key, value := range header {
8385
// discard HTTP host header for backing to source successfully

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.