diff --git a/internal/pool.go b/internal/pool.go index d447d2c..16e27fc 100644 --- a/internal/pool.go +++ b/internal/pool.go @@ -294,7 +294,6 @@ func (pool *Pool) Invoke(v interface{}) { return } req.SetHeaders(pool.Headers) - start := time.Now() resp, reqerr := pool.client.Do(pool.ctx, req) if pool.ClientType == ihttp.FAST { diff --git a/pkg/baseline.go b/pkg/baseline.go index a2459d2..62543c5 100644 --- a/pkg/baseline.go +++ b/pkg/baseline.go @@ -33,12 +33,16 @@ func NewBaseline(u, host string, resp *ihttp.Response) *Baseline { copy(bl.Header, header) bl.HeaderLength = len(bl.Header) - body := resp.Body() - bl.Body = make([]byte, len(body)) - copy(bl.Body, body) - bl.BodyLength = resp.ContentLength() - if bl.BodyLength == -1 { - bl.BodyLength = len(bl.Body) + if i := resp.ContentLength(); i != 0 { + body := resp.Body() + bl.Body = make([]byte, len(body)) + copy(bl.Body, body) + + if i == -1 { + bl.BodyLength = len(bl.Body) + } else { + bl.BodyLength = i + } } if t, ok := ContentTypeMap[resp.ContentType()]; ok {