Commit 413dc1d2 authored by bloonfield's avatar bloonfield Committed by Péter Szilágyi

rpc: fix closure problem in batch processing (#14688)

Demo of the issue: https://play.golang.org/p/EeTLFfppqC
parent fdf2184b
...@@ -103,8 +103,8 @@ func (c *Client) sendBatchHTTP(ctx context.Context, op *requestOp, msgs []*jsonr ...@@ -103,8 +103,8 @@ func (c *Client) sendBatchHTTP(ctx context.Context, op *requestOp, msgs []*jsonr
if err := json.NewDecoder(respBody).Decode(&respmsgs); err != nil { if err := json.NewDecoder(respBody).Decode(&respmsgs); err != nil {
return err return err
} }
for _, respmsg := range respmsgs { for i := 0; i < len(respmsgs); i++ {
op.resp <- &respmsg op.resp <- &respmsgs[i]
} }
return nil return nil
} }
......
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