fix: avoid HTTP zero connections (#729)

This commit is contained in:
Levi authored and GitHub committed 2024-09-07 13:49:32 +08:00
1 parent 51244133e0
commit a1981328aa
1 file changed
+5 -1
+5 -1
View File
@@ -171,8 +171,12 @@ func (f *Fetcher) Create(opts *base.Options) error {
opts.Extra = &fhttp.OptsExtra{}
}
extra := opts.Extra.(*fhttp.OptsExtra)
if extra.Connections == 0 {
if extra.Connections <= 0 {
extra.Connections = f.config.Connections
// Avoid zero connections configuration
if extra.Connections <= 0 {
extra.Connections = 1
}
}
return nil
}