From a8c17fdc332081907bc3101e58ca976007ea7421 Mon Sep 17 00:00:00 2001 From: liwei Date: Fri, 6 Sep 2024 14:42:21 +0800 Subject: [PATCH] fix: avoid HTTP zero connections --- 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 3647c2c4b..fc1a40a8c 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 }