Skip to content

Commit

Permalink
Don't retry client requests with ErrBodyTooLarge
Browse files Browse the repository at this point in the history
Fixes #455
  • Loading branch information
erikdubbelboer committed Nov 12, 2018
1 parent 63a0b46 commit fcaab42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,9 @@ func (c *HostClient) doNonNilReqResp(req *Request, resp *Response) (bool, error)
if err = resp.ReadLimitBody(br, c.MaxResponseBodySize); err != nil {
c.releaseReader(br)
c.closeConn(cc)
return true, err
// Don't retry in case of ErrBodyTooLarge since we will just get the same again.
retry := err != ErrBodyTooLarge
return retry, err
}
c.releaseReader(br)

Expand Down

0 comments on commit fcaab42

Please sign in to comment.