From a1981328aae2248dd80cc7e332a2affb0a695b8d Mon Sep 17 00:00:00 2001 From: Levi Date: Sat, 7 Sep 2024 13:49:32 +0800 Subject: [PATCH] fix: avoid HTTP zero connections (#729) --- internal/protocol/http/fetcher.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/protocol/http/fetcher.go b/internal/protocol/http/fetcher.go index 399ea01c2..75ada8408 100644 --- a/internal/protocol/http/fetcher.go +++ b/internal/protocol/http/fetcher.go @@ -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 }