mirror of
https://github.com/chainreactors/spray.git
synced 2025-05-06 10:41:21 +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,
|
Config: config,
|
||||||
ctx: pctx,
|
ctx: pctx,
|
||||||
cancel: cancel,
|
cancel: cancel,
|
||||||
client: ihttp.NewClient(config.Thread, 2, config.ClientType),
|
client: ihttp.NewClient(config.Thread, config.Timeout, config.ClientType),
|
||||||
wg: sync.WaitGroup{},
|
wg: sync.WaitGroup{},
|
||||||
additionCh: make(chan *Unit, 100),
|
additionCh: make(chan *Unit, 100),
|
||||||
closeCh: make(chan struct{}),
|
closeCh: make(chan struct{}),
|
||||||
|
@ -47,7 +47,7 @@ func NewPool(ctx context.Context, config *pkg.Config) (*Pool, error) {
|
|||||||
url: u,
|
url: u,
|
||||||
ctx: pctx,
|
ctx: pctx,
|
||||||
cancel: cancel,
|
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),
|
baselines: make(map[int]*pkg.Baseline),
|
||||||
urls: make(map[string]struct{}),
|
urls: make(map[string]struct{}),
|
||||||
scopeurls: 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,
|
Renegotiation: tls.RenegotiateOnceAsClient,
|
||||||
InsecureSkipVerify: true,
|
InsecureSkipVerify: true,
|
||||||
},
|
},
|
||||||
TLSHandshakeTimeout: time.Duration(timeout) * time.Second,
|
MaxConnsPerHost: thread * 3 / 2,
|
||||||
MaxConnsPerHost: thread * 3 / 2,
|
IdleConnTimeout: time.Duration(timeout) * time.Second,
|
||||||
IdleConnTimeout: time.Duration(timeout) * time.Second,
|
ReadBufferSize: 16384, // 16k
|
||||||
ReadBufferSize: 16384, // 16k
|
|
||||||
},
|
},
|
||||||
Timeout: time.Second * time.Duration(timeout),
|
Timeout: time.Second * time.Duration(timeout),
|
||||||
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user