MINOR: acme: retry label always do a request
Doing a retry always result in initializing a request again, set ACME_HTTP_REQ directly in the label instead of doing it for each step.
This commit is contained in:
parent
c589964bcc
commit
51f9415d5e
13
src/acme.c
13
src/acme.c
@ -1757,7 +1757,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
|
|
||||||
if (http_st == ACME_HTTP_RES) {
|
if (http_st == ACME_HTTP_RES) {
|
||||||
if (acme_directory(task, ctx, &errmsg) != 0) {
|
if (acme_directory(task, ctx, &errmsg) != 0) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
st = ACME_NEWNONCE;
|
st = ACME_NEWNONCE;
|
||||||
@ -1772,7 +1771,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
}
|
}
|
||||||
if (http_st == ACME_HTTP_RES) {
|
if (http_st == ACME_HTTP_RES) {
|
||||||
if (acme_nonce(task, ctx, &errmsg) != 0) {
|
if (acme_nonce(task, ctx, &errmsg) != 0) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
st = ACME_CHKACCOUNT;
|
st = ACME_CHKACCOUNT;
|
||||||
@ -1788,7 +1786,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
}
|
}
|
||||||
if (http_st == ACME_HTTP_RES) {
|
if (http_st == ACME_HTTP_RES) {
|
||||||
if (acme_res_account(task, ctx, 0, &errmsg) != 0) {
|
if (acme_res_account(task, ctx, 0, &errmsg) != 0) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
if (!isttest(ctx->kid))
|
if (!isttest(ctx->kid))
|
||||||
@ -1806,7 +1803,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
}
|
}
|
||||||
if (http_st == ACME_HTTP_RES) {
|
if (http_st == ACME_HTTP_RES) {
|
||||||
if (acme_res_account(task, ctx, 1, &errmsg) != 0) {
|
if (acme_res_account(task, ctx, 1, &errmsg) != 0) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
st = ACME_NEWORDER;
|
st = ACME_NEWORDER;
|
||||||
@ -1823,7 +1819,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
}
|
}
|
||||||
if (http_st == ACME_HTTP_RES) {
|
if (http_st == ACME_HTTP_RES) {
|
||||||
if (acme_res_neworder(task, ctx, &errmsg) != 0) {
|
if (acme_res_neworder(task, ctx, &errmsg) != 0) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
st = ACME_AUTH;
|
st = ACME_AUTH;
|
||||||
@ -1838,7 +1833,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
}
|
}
|
||||||
if (http_st == ACME_HTTP_RES) {
|
if (http_st == ACME_HTTP_RES) {
|
||||||
if (acme_res_auth(task, ctx, ctx->next_auth, &errmsg) != 0) {
|
if (acme_res_auth(task, ctx, ctx->next_auth, &errmsg) != 0) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
http_st = ACME_HTTP_REQ;
|
http_st = ACME_HTTP_REQ;
|
||||||
@ -1859,7 +1853,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
enum acme_ret ret = acme_res_challenge(task, ctx, ctx->next_auth, 0, &errmsg);
|
enum acme_ret ret = acme_res_challenge(task, ctx, ctx->next_auth, 0, &errmsg);
|
||||||
|
|
||||||
if (ret == ACME_RET_RETRY) {
|
if (ret == ACME_RET_RETRY) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
} else if (ret == ACME_RET_FAIL) {
|
} else if (ret == ACME_RET_FAIL) {
|
||||||
goto end;
|
goto end;
|
||||||
@ -1881,7 +1874,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
if (http_st == ACME_HTTP_RES) {
|
if (http_st == ACME_HTTP_RES) {
|
||||||
enum acme_ret ret = acme_res_challenge(task, ctx, ctx->next_auth, 1, &errmsg);
|
enum acme_ret ret = acme_res_challenge(task, ctx, ctx->next_auth, 1, &errmsg);
|
||||||
if (ret == ACME_RET_RETRY) {
|
if (ret == ACME_RET_RETRY) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
} else if (ret == ACME_RET_FAIL) {
|
} else if (ret == ACME_RET_FAIL) {
|
||||||
goto abort;
|
goto abort;
|
||||||
@ -1901,7 +1893,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
}
|
}
|
||||||
if (http_st == ACME_HTTP_RES) {
|
if (http_st == ACME_HTTP_RES) {
|
||||||
if (acme_res_finalize(task, ctx, &errmsg) != 0) {
|
if (acme_res_finalize(task, ctx, &errmsg) != 0) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
http_st = ACME_HTTP_REQ;
|
http_st = ACME_HTTP_REQ;
|
||||||
@ -1916,7 +1907,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
}
|
}
|
||||||
if (http_st == ACME_HTTP_RES) {
|
if (http_st == ACME_HTTP_RES) {
|
||||||
if (acme_res_chkorder(task, ctx, &errmsg) != 0) {
|
if (acme_res_chkorder(task, ctx, &errmsg) != 0) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
http_st = ACME_HTTP_REQ;
|
http_st = ACME_HTTP_REQ;
|
||||||
@ -1931,7 +1921,6 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
}
|
}
|
||||||
if (http_st == ACME_HTTP_RES) {
|
if (http_st == ACME_HTTP_RES) {
|
||||||
if (acme_res_certificate(task, ctx, &errmsg) != 0) {
|
if (acme_res_certificate(task, ctx, &errmsg) != 0) {
|
||||||
http_st = ACME_HTTP_REQ;
|
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
http_st = ACME_HTTP_REQ;
|
http_st = ACME_HTTP_REQ;
|
||||||
@ -1953,7 +1942,7 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
|
|||||||
return task;
|
return task;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
ctx->http_state = http_st;
|
ctx->http_state = ACME_HTTP_REQ;
|
||||||
ctx->state = st;
|
ctx->state = st;
|
||||||
|
|
||||||
ctx->retries--;
|
ctx->retries--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user