From da3a8d52ea22bfc89b7e2ca884f262bb09ad9d6b Mon Sep 17 00:00:00 2001 From: Nick Tan Date: Wed, 9 Mar 2016 08:20:20 -0800 Subject: [PATCH] feature #6: new Request/Response instance every time, for a lock free approach --- src/github.com/eriklupander/gotling/httpreq.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/github.com/eriklupander/gotling/httpreq.go b/src/github.com/eriklupander/gotling/httpreq.go index baf0dad..77455e1 100644 --- a/src/github.com/eriklupander/gotling/httpreq.go +++ b/src/github.com/eriklupander/gotling/httpreq.go @@ -43,15 +43,12 @@ func DoHttpRequest(httpAction HttpAction, resultsChannel chan HttpReqResult, ses // TODO ADD TLS CERT CONF SUPPORT c := &fasthttp.Client{} - req := fasthttp.AcquireRequest() + req := &fasthttp.Request{} req.Header.SetMethod(httpAction.Method) req.Header.SetRequestURI(SubstParams(sessionMap, httpAction.Url)) req.Header.Set("Accept", httpAction.Accept) - resp := fasthttp.AcquireResponse() - - defer fasthttp.ReleaseResponse(resp) - defer fasthttp.ReleaseRequest(req) + resp := &fasthttp.Response{} // TODO ADD TIMEOUT SUPPORT start := time.Now()