Skip to content

Commit

Permalink
[fix] avoid int overflow on smaller platforms - closes gocolly#210
Browse files Browse the repository at this point in the history
  • Loading branch information
asciimoo committed Aug 17, 2018
1 parent 732c641 commit 5ed0687
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (h *httpBackend) Do(request *http.Request, bodySize int) (*Response, error)
defer func(r *LimitRule) {
randomDelay := time.Duration(0)
if r.RandomDelay != 0 {
randomDelay = time.Duration(rand.Intn(int(r.RandomDelay)))
randomDelay = time.Duration(rand.Int63n(int64(r.RandomDelay)))
}
time.Sleep(r.Delay + randomDelay)
<-r.waitChan
Expand Down

0 comments on commit 5ed0687

Please sign in to comment.