From 0a8f9b0a622c8ba0ce545c9a87b89276b4813bfa Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Fri, 15 Feb 2019 17:20:00 +0300 Subject: [PATCH] fix race in http transport Signed-off-by: Vasiliy Tolstov --- transport/http_transport.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/transport/http_transport.go b/transport/http_transport.go index ea98accc..3aed66be 100644 --- a/transport/http_transport.go +++ b/transport/http_transport.go @@ -133,12 +133,6 @@ func (h *httpTransportClient) Recv(m *Message) error { r = rc } - h.RLock() - if h.buff == nil { - return io.EOF - } - h.RUnlock() - // set timeout if its greater than 0 if h.ht.opts.Timeout > time.Duration(0) { h.conn.SetDeadline(time.Now().Add(h.ht.opts.Timeout)) @@ -181,7 +175,6 @@ func (h *httpTransportClient) Close() error { h.once.Do(func() { h.Lock() h.buff.Reset(nil) - h.buff = nil h.Unlock() close(h.r) })