Skip to content

Commit

Permalink
etcdserver/api/rafthttp: fix the location of close http body.
Browse files Browse the repository at this point in the history
  • Loading branch information
johncming committed Mar 11, 2019
1 parent 6da17cd commit bd41f74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion etcdserver/api/rafthttp/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ func (p *pipeline) post(data []byte) (err error) {
p.picker.unreachable(u)
return err
}
defer resp.Body.Close()
b, err := ioutil.ReadAll(resp.Body)
if err != nil {
p.picker.unreachable(u)
return err
}
resp.Body.Close()

err = checkPostResponse(resp, b, req, p.peerID)
if err != nil {
Expand Down

0 comments on commit bd41f74

Please sign in to comment.