mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-25 14:12:13 +00:00
CLEANUP: ssl/cli: do not loop on unknown states in "add ssl crt-list" handler
The io_handler in "add ssl crt_list" is built around a "while" loop that only makes forward progress and that doesn't handle its final state as it's not supposed to be called again once reached. This makes the code confusing because its construct implies an infinite loop for such a state (or any other unhandled one). Let's just remove that unneeded loop.
This commit is contained in:
parent
4fd9b4ddf0
commit
1b948ef426
@ -1061,7 +1061,6 @@ static int cli_io_handler_add_crtlist(struct appctx *appctx)
|
|||||||
if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
|
if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
while (1) {
|
|
||||||
switch (appctx->st2) {
|
switch (appctx->st2) {
|
||||||
case SETCERT_ST_INIT:
|
case SETCERT_ST_INIT:
|
||||||
/* This state just print the update message */
|
/* This state just print the update message */
|
||||||
@ -1118,11 +1117,8 @@ static int cli_io_handler_add_crtlist(struct appctx *appctx)
|
|||||||
}
|
}
|
||||||
entry->linenum = ++crtlist->linecount;
|
entry->linenum = ++crtlist->linecount;
|
||||||
appctx->st2 = SETCERT_ST_FIN;
|
appctx->st2 = SETCERT_ST_FIN;
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
|
||||||
chunk_appendf(trash, "\n");
|
chunk_appendf(trash, "\n");
|
||||||
if (errcode & ERR_WARN)
|
if (errcode & ERR_WARN)
|
||||||
chunk_appendf(trash, "%s", err);
|
chunk_appendf(trash, "%s", err);
|
||||||
|
Loading…
Reference in New Issue
Block a user