BUG/MINOR: ssl_ckch: Dump cert transaction only once if show command yield

When loaded SSL certificates are displayed via "show ssl cert" command, the
in-progess transaction, if any, is also displayed. However, if the command
yield, the transaction is re-displayed again and again.

To fix the issue, old_ckchs field is used to remember the transaction was
already displayed.

This patch must be backported as far as 2.2.
This commit is contained in:
Christopher Faulet 2022-06-03 10:46:40 +02:00
parent 5a2154bf7c
commit 3e94f5d4b6

View File

@ -1327,12 +1327,13 @@ static int cli_io_handler_show_cert(struct appctx *appctx)
if (trash == NULL)
return 1;
if (!ctx->old_ckchs) {
if (ckchs_transaction.old_ckchs) {
ckchs = ckchs_transaction.old_ckchs;
chunk_appendf(trash, "# transaction\n");
chunk_appendf(trash, "*%s\n", ckchs->path);
}
if (!ctx->old_ckchs && ckchs_transaction.old_ckchs) {
ckchs = ckchs_transaction.old_ckchs;
chunk_appendf(trash, "# transaction\n");
chunk_appendf(trash, "*%s\n", ckchs->path);
if (applet_putchk(appctx, trash) == -1)
goto yield;
ctx->old_ckchs = ckchs_transaction.old_ckchs;
}
if (!ctx->cur_ckchs) {