Skip to content

Commit 413dc1d

Browse files
bloonfieldkaralabe
authored andcommitted
rpc: fix closure problem in batch processing (#14688)
Demo of the issue: https://play.golang.org/p/EeTLFfppqC
1 parent fdf2184 commit 413dc1d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎rpc/http.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ func (c *Client) sendBatchHTTP(ctx context.Context, op *requestOp, msgs []*jsonr
103103
if err := json.NewDecoder(respBody).Decode(&respmsgs); err != nil {
104104
return err
105105
}
106-
for _, respmsg := range respmsgs {
107-
op.resp <- &respmsg
106+
for i := 0; i < len(respmsgs); i++ {
107+
op.resp <- &respmsgs[i]
108108
}
109109
return nil
110110
}

0 commit comments

Comments
 (0)