istfree(&ctx->nonce);
ctx->nonce = istdup(hdr->v);
}
+ /* get the next retry timing */
+ if (isteqi(hdr->n, ist("Retry-After"))) {
+ ctx->retryafter = atol(hdr->v.ptr);
+ }
}
if (hc->res.status < 200 || hc->res.status >= 300) {
istfree(&ctx->nonce);
ctx->nonce = istdup(hdr->v);
}
+ /* get the next retry timing */
+ if (isteqi(hdr->n, ist("Retry-After"))) {
+ ctx->retryafter = atol(hdr->v.ptr);
+ }
}
if (hc->res.status < 200 || hc->res.status >= 300) {
istfree(&ctx->nonce);
ctx->nonce = istdup(hdr->v);
}
+ /* get the next retry timing */
+ if (isteqi(hdr->n, ist("Retry-After"))) {
+ ctx->retryafter = atol(hdr->v.ptr);
+ }
}
if (hc->res.status < 200 || hc->res.status >= 300) {
istfree(&ctx->nonce);
ctx->nonce = istdup(hdr->v);
}
+ /* get the next retry timing */
+ if (isteqi(hdr->n, ist("Retry-After"))) {
+ ctx->retryafter = atol(hdr->v.ptr);
+ }
}
if (hc->res.status < 200 || hc->res.status >= 300 || mjson_find(hc->res.buf.area, hc->res.buf.data, "$.error", NULL, NULL) == MJSON_TOK_OBJECT) {
istfree(&ctx->nonce);
ctx->nonce = istdup(hdr->v);
}
+ /* get the next retry timing */
+ if (isteqi(hdr->n, ist("Retry-After"))) {
+ ctx->retryafter = atol(hdr->v.ptr);
+ }
+
}
if (hc->res.status < 200 || hc->res.status >= 300) {
istfree(&ctx->nonce);
ctx->nonce = istdup(hdr->v);
}
+ /* get the next retry timing */
+ if (isteqi(hdr->n, ist("Retry-After"))) {
+ ctx->retryafter = atol(hdr->v.ptr);
+ }
/* get the order URL */
if (isteqi(hdr->n, ist("Location"))) {
istfree(&ctx->order);
istfree(&ctx->kid);
ctx->kid = istdup(hdr->v);
}
+ /* get the next retry timing */
+ if (isteqi(hdr->n, ist("Retry-After"))) {
+ ctx->retryafter = atol(hdr->v.ptr);
+ }
if (isteqi(hdr->n, ist("Replay-Nonce"))) {
istfree(&ctx->nonce);
ctx->nonce = istdup(hdr->v);
int delay = 1;
int i;
- for (i = 0; i < ACME_RETRY - ctx->retries; i++)
- delay *= 3;
- send_log(NULL, LOG_NOTICE, "acme: %s: %s, retrying in %ds (%d/%d)...\n", ctx->store->path, errmsg ? errmsg : "", delay, ACME_RETRY - ctx->retries, ACME_RETRY);
+ if (ctx->retryafter > 0) {
+ /* Use the Retry-After value from the header */
+ delay = ctx->retryafter;
+ ctx->retryafter = 0;
+ } else {
+ /* else does an exponential backoff * 3 */
+ for (i = 0; i < ACME_RETRY - ctx->retries; i++)
+ delay *= 3;
+ }
+ send_log(NULL, LOG_NOTICE, "acme: %s: %s, retrying in %ds (%d/%d retries)...\n", ctx->store->path, errmsg ? errmsg : "", delay, ACME_RETRY - ctx->retries, ACME_RETRY);
task->expire = tick_add(now_ms, delay * 1000);
} else {