Fix lint
parent
a1e2791271
commit
0aac1eb685
|
@ -11,11 +11,11 @@ import (
|
|||
)
|
||||
|
||||
// EnumerateSubdomains enumerates all the subdomains for a given domain
|
||||
func (a *Agent) EnumerateSubdomains(domain string, keys *subscraping.Keys, proxy string, rl int, timeout int, maxEnumTime time.Duration) chan subscraping.Result {
|
||||
func (a *Agent) EnumerateSubdomains(domain string, keys *subscraping.Keys, proxy string, rateLimit, timeout int, maxEnumTime time.Duration) chan subscraping.Result {
|
||||
results := make(chan subscraping.Result)
|
||||
|
||||
go func() {
|
||||
session, err := subscraping.NewSession(domain, keys, proxy, rl, timeout)
|
||||
session, err := subscraping.NewSession(domain, keys, proxy, rateLimit, timeout)
|
||||
if err != nil {
|
||||
results <- subscraping.Result{Type: subscraping.Error, Error: fmt.Errorf("could not init passive session for %s: %s", domain, err)}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ import (
|
|||
)
|
||||
|
||||
// NewSession creates a new session object for a domain
|
||||
func NewSession(domain string, keys *Keys, proxy string, rl int, timeout int) (*Session, error) {
|
||||
func NewSession(domain string, keys *Keys, proxy string, rateLimit, timeout int) (*Session, error) {
|
||||
Transport := &http.Transport{
|
||||
MaxIdleConns: 100,
|
||||
MaxIdleConnsPerHost: 100,
|
||||
|
@ -47,8 +47,8 @@ func NewSession(domain string, keys *Keys, proxy string, rl int, timeout int) (*
|
|||
}
|
||||
|
||||
// Initiate rate limit instance
|
||||
if rl > 0 {
|
||||
session.RateLimiter = ratelimit.New(rl)
|
||||
if rateLimit > 0 {
|
||||
session.RateLimiter = ratelimit.New(rateLimit)
|
||||
} else {
|
||||
session.RateLimiter = ratelimit.NewUnlimited()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue