connections per host implementation

This commit is contained in:
Alex 2017-09-04 18:44:58 -04:00
parent 17afe8a6dd
commit 7764297a42
2 changed files with 18 additions and 11 deletions

@ -98,6 +98,11 @@ func validateFrameworkConfiguration() {
log.Fatalf("need at least one sender, given %d", config.Senders)
}
// validate connections per host
if config.ConnectionsPerHost <= 0 {
log.Fatalf("need at least one connection, given %d", config.ConnectionsPerHost)
}
// Stop the lowliest idiot from using this to DoS people
if config.ConnectionsPerHost > 50 || config.ConnectionsPerHost < 1 {
log.Fatalf("connectionsPerHost must be in the range [0,50]")

@ -88,9 +88,11 @@ func Process(mon *Monitor) {
for i := 0; i < workers; i++ {
go func() {
for obj := range processQueue {
for run := uint(0); run < config.ConnectionsPerHost; run++ {
result := grabTarget(obj, mon)
outputQueue <- result
}
}
workerDone.Done()
}()
}