etcdserver/api/rafthttp: fix the location of close http body.

This commit is contained in:
johncming 2019-03-11 22:20:38 +08:00
parent 6da17cda18
commit bd41f74168

View File

@ -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 {