diff --git a/transport/http_transport.go b/transport/http_transport.go index 1c454f90..7cb8d3c9 100644 --- a/transport/http_transport.go +++ b/transport/http_transport.go @@ -159,13 +159,14 @@ func (h *httpTransportClient) Recv(m *Message) error { return io.EOF } rsp, err := http.ReadResponse(h.buff, r) - h.Unlock() if err != nil { + h.Unlock() return err } defer rsp.Body.Close() b, err := ioutil.ReadAll(rsp.Body) + h.Unlock() if err != nil { return err }