From b358655221acefad58f2838e03803db628961a48 Mon Sep 17 00:00:00 2001 From: Roy Date: Wed, 17 Mar 2021 19:39:49 +0200 Subject: [PATCH] fix send timeout timer.reset usage --- httpblaster/worker/worker_base.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/httpblaster/worker/worker_base.go b/httpblaster/worker/worker_base.go index be379b2..f4c27ac 100644 --- a/httpblaster/worker/worker_base.go +++ b/httpblaster/worker/worker_base.go @@ -133,6 +133,9 @@ func (w *WorkerBase) send(req *fasthttp.Request, resp *fasthttp.Response, w.ch_duration <- end.Sub(start) }() + if !w.timer.Stop() { + <-w.timer.C + } w.timer.Reset(timeout) select { case duration := <-w.ch_duration: