From 04b447c1bfdadd22e4cf1b00254a5828d52a9097 Mon Sep 17 00:00:00 2001 From: Yaron Niddam Date: Sun, 10 Nov 2024 18:34:11 +0200 Subject: [PATCH] Add option for clear global `normalClient` dialer --- pkg/protocols/network/networkclientpool/clientpool.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/protocols/network/networkclientpool/clientpool.go b/pkg/protocols/network/networkclientpool/clientpool.go index a67cee2967..218b2e1dfe 100644 --- a/pkg/protocols/network/networkclientpool/clientpool.go +++ b/pkg/protocols/network/networkclientpool/clientpool.go @@ -2,6 +2,7 @@ package networkclientpool import ( "github.com/projectdiscovery/fastdialer/fastdialer" + "github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate" "github.com/projectdiscovery/nuclei/v3/pkg/types" ) @@ -32,3 +33,10 @@ func (c *Configuration) Hash() string { func Get(options *types.Options, configuration *Configuration /*TODO review unused parameters*/) (*fastdialer.Dialer, error) { return normalClient, nil } + +// Clear clears cached client pool implementation +func Clear() { + if normalClient != nil { + normalClient = nil + } +}