Commit e7519fa5 authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #2856 from ipfs/fix/send-msg-race

pass reference to reader instead of using the one on the object
parents 478d3251 23050f9e
......@@ -228,9 +228,9 @@ func (ms *messageSender) SendRequest(ctx context.Context, pmes *pb.Message) (*pb
func (ms *messageSender) ctxReadMsg(ctx context.Context, mes *pb.Message) error {
errc := make(chan error, 1)
go func() {
errc <- ms.r.ReadMsg(mes)
}()
go func(r ggio.ReadCloser) {
errc <- r.ReadMsg(mes)
}(ms.r)
select {
case err := <-errc:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment