sendBatchHTTP bug: if call batch rpc, the result weren't right. It's a typical closure problem.

This commit is contained in:
Bianlongfei 2017-06-23 17:55:11 +08:00
parent 78c04c920d
commit 0c2b9699a8

View file

@ -103,8 +103,8 @@ func (c *Client) sendBatchHTTP(ctx context.Context, op *requestOp, msgs []*jsonr
if err := json.NewDecoder(respBody).Decode(&respmsgs); err != nil {
return err
}
for _, respmsg := range respmsgs {
op.resp <- &respmsg
for i := 0; i < len(respmsgs); i++ {
op.resp <- &respmsgs[i]
}
return nil
}