Apply suggestions from code review

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

Co-authored-by: Richard Wall <wallrj@users.noreply.github.com>
This commit is contained in:
Maartje Eyskens 2020-11-17 16:03:58 +01:00 committed by GitHub
parent 7c5cedf103
commit 4758efe7da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,12 +29,13 @@ func RetryBackoff(n int, r *http.Request, resp *http.Response) time.Duration {
// According to the spec badNonce is urn:ietf:params:acme:error:badNonce.
// However, we can not use the request body in here as it is closed already.
// So we're using it's status code instead: 400
// So we're using its status code instead: 400
if resp.StatusCode == http.StatusBadRequest {
// don't retry more than 6 times, if we get 6 nonce mismatches something is quite wrong
if n > 5 {
return -1
} else if n < 1 {
}
if n < 1 {
// n is used for the backoff time below
n = 1
}