diff --git a/internal/checkpool.go b/internal/checkpool.go index c7e8ff7..9042951 100644 --- a/internal/checkpool.go +++ b/internal/checkpool.go @@ -23,7 +23,7 @@ func NewCheckPool(ctx context.Context, config *pkg.Config) (*CheckPool, error) { Config: config, ctx: pctx, cancel: cancel, - client: ihttp.NewClient(config.Thread, 2, config.ClientType), + client: ihttp.NewClient(config.Thread, config.Timeout, config.ClientType), wg: sync.WaitGroup{}, additionCh: make(chan *Unit, 100), closeCh: make(chan struct{}), diff --git a/internal/pool.go b/internal/pool.go index 0d60a4a..8865c05 100644 --- a/internal/pool.go +++ b/internal/pool.go @@ -47,7 +47,7 @@ func NewPool(ctx context.Context, config *pkg.Config) (*Pool, error) { url: u, ctx: pctx, cancel: cancel, - client: ihttp.NewClient(config.Thread, 2, config.ClientType), + client: ihttp.NewClient(config.Thread, config.Timeout, config.ClientType), baselines: make(map[int]*pkg.Baseline), urls: make(map[string]struct{}), scopeurls: make(map[string]struct{}), diff --git a/pkg/ihttp/client.go b/pkg/ihttp/client.go index 39d093b..05b3cae 100644 --- a/pkg/ihttp/client.go +++ b/pkg/ihttp/client.go @@ -51,10 +51,9 @@ func NewClient(thread int, timeout int, clientType int) *Client { Renegotiation: tls.RenegotiateOnceAsClient, InsecureSkipVerify: true, }, - TLSHandshakeTimeout: time.Duration(timeout) * time.Second, - MaxConnsPerHost: thread * 3 / 2, - IdleConnTimeout: time.Duration(timeout) * time.Second, - ReadBufferSize: 16384, // 16k + MaxConnsPerHost: thread * 3 / 2, + IdleConnTimeout: time.Duration(timeout) * time.Second, + ReadBufferSize: 16384, // 16k }, Timeout: time.Second * time.Duration(timeout), CheckRedirect: func(req *http.Request, via []*http.Request) error {