fix checkpool time not work

This commit is contained in:
M09Ic 2024-09-23 14:59:05 +08:00
parent a942bac337
commit 7693b4d38f
3 changed files with 4 additions and 4 deletions

View File

@ -47,8 +47,8 @@ func NewClient(config *ClientConfig) *Client {
MaxConnsPerHost: config.Thread * 3 / 2, MaxConnsPerHost: config.Thread * 3 / 2,
MaxIdleConnDuration: config.Timeout, MaxIdleConnDuration: config.Timeout,
//MaxConnWaitTimeout: time.Duration(timeout) * time.Second, //MaxConnWaitTimeout: time.Duration(timeout) * time.Second,
ReadTimeout: config.Timeout * time.Second, ReadTimeout: config.Timeout,
WriteTimeout: config.Timeout * time.Second, WriteTimeout: config.Timeout,
ReadBufferSize: 16384, // 16k ReadBufferSize: 16384, // 16k
MaxResponseBodySize: int(DefaultMaxBodySize), MaxResponseBodySize: int(DefaultMaxBodySize),
NoDefaultUserAgentHeader: true, NoDefaultUserAgentHeader: true,

View File

@ -97,7 +97,7 @@ type OutputOptions struct {
type RequestOptions struct { type RequestOptions struct {
Method string `short:"x" long:"method" default:"GET" description:"String, request method, e.g.: --method POST" config:"method"` Method string `short:"x" long:"method" default:"GET" description:"String, request method, e.g.: --method POST" config:"method"`
Headers []string `long:"header" description:"Strings, custom headers, e.g.: --headers 'Auth: example_auth'" config:"headers"` Headers []string `long:"header" description:"Strings, custom headers, e.g.: --header 'Auth: example_auth'" config:"headers"`
UserAgent string `long:"user-agent" description:"String, custom user-agent, e.g.: --user-agent Custom" config:"useragent"` UserAgent string `long:"user-agent" description:"String, custom user-agent, e.g.: --user-agent Custom" config:"useragent"`
RandomUserAgent bool `long:"random-agent" description:"Bool, use random with default user-agent" config:"random-useragent"` RandomUserAgent bool `long:"random-agent" description:"Bool, use random with default user-agent" config:"random-useragent"`
Cookie []string `long:"cookie" description:"Strings, custom cookie" config:"cookies"` Cookie []string `long:"cookie" description:"Strings, custom cookie" config:"cookies"`

View File

@ -26,7 +26,7 @@ func NewCheckPool(ctx context.Context, config *Config) (*CheckPool, error) {
client: ihttp.NewClient(&ihttp.ClientConfig{ client: ihttp.NewClient(&ihttp.ClientConfig{
Thread: config.Thread, Thread: config.Thread,
Type: config.ClientType, Type: config.ClientType,
Timeout: time.Duration(config.Timeout) * time.Second, Timeout: config.Timeout,
ProxyAddr: config.ProxyAddr, ProxyAddr: config.ProxyAddr,
}), }),
wg: &sync.WaitGroup{}, wg: &sync.WaitGroup{},