Type rate as uint64

This commit is contained in:
Tomás Senart
2013-08-16 20:08:10 +02:00
parent e9fc844fd1
commit a2d4d25dec
2 changed files with 6 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ func init() {
func main() {
var (
rate = flag.Uint("rate", 50, "Requests per second")
rate = flag.Uint64("rate", 50, "Requests per second")
targetsf = flag.String("targets", "targets.txt", "Targets file")
ordering = flag.String("ordering", "random", "Attack ordering [sequential, random]")
duration = flag.Duration("duration", 10*time.Second, "Duration of the test")
@@ -84,8 +84,8 @@ func main() {
}
}
func attack(targets Targets, ordering string, rate uint, duration time.Duration, rep Reporter) {
hits := make(chan *http.Request, rate*uint((duration).Seconds()))
func attack(targets Targets, ordering string, rate uint64, duration time.Duration, rep Reporter) {
hits := make(chan *http.Request, rate*uint64((duration).Seconds()))
defer close(hits)
responses := make(chan *Response, cap(hits))
defer close(responses)