mirror of
https://github.com/chainreactors/spray.git
synced 2025-05-06 18:51:22 +00:00
修复--timeout实际没生效的bug
This commit is contained in:
parent
db29ce3e39
commit
a36e06e96b
@ -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{}),
|
||||
|
@ -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{}),
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user