mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-01 09:42:02 +00:00
MINOR: ssl/cli: Add ha_(warning|alert) msgs to CLI ckch callback
This patch allows cli_io_handler_commit_cert() callback called upon a "commit ssl cert ..." command to prefix the messages returned by the CLI to the by the ones built by ha_warining(), ha_alert(). Should be interesting to backport this commit to 2.8.
This commit is contained in:
parent
7dab3e8266
commit
456ba6e95f
@ -2147,6 +2147,7 @@ static int cli_io_handler_commit_cert(struct appctx *appctx)
|
|||||||
struct ckch_store *old_ckchs, *new_ckchs = NULL;
|
struct ckch_store *old_ckchs, *new_ckchs = NULL;
|
||||||
struct ckch_inst *ckchi;
|
struct ckch_inst *ckchi;
|
||||||
|
|
||||||
|
usermsgs_clr("CLI");
|
||||||
/* FIXME: Don't watch the other side !*/
|
/* FIXME: Don't watch the other side !*/
|
||||||
if (unlikely(sc_opposite(sc)->flags & SC_FL_SHUT_DONE))
|
if (unlikely(sc_opposite(sc)->flags & SC_FL_SHUT_DONE))
|
||||||
goto end;
|
goto end;
|
||||||
@ -2220,7 +2221,8 @@ static int cli_io_handler_commit_cert(struct appctx *appctx)
|
|||||||
ctx->state = CERT_ST_SUCCESS;
|
ctx->state = CERT_ST_SUCCESS;
|
||||||
__fallthrough;
|
__fallthrough;
|
||||||
case CERT_ST_SUCCESS:
|
case CERT_ST_SUCCESS:
|
||||||
if (applet_putstr(appctx, "\nSuccess!\n") == -1)
|
chunk_printf(&trash, "\n%sSuccess!\n", usermsgs_str());
|
||||||
|
if (applet_putchk(appctx, &trash) == -1)
|
||||||
goto yield;
|
goto yield;
|
||||||
ctx->state = CERT_ST_FIN;
|
ctx->state = CERT_ST_FIN;
|
||||||
__fallthrough;
|
__fallthrough;
|
||||||
@ -2233,7 +2235,7 @@ static int cli_io_handler_commit_cert(struct appctx *appctx)
|
|||||||
|
|
||||||
case CERT_ST_ERROR:
|
case CERT_ST_ERROR:
|
||||||
error:
|
error:
|
||||||
chunk_printf(&trash, "\n%sFailed!\n", ctx->err);
|
chunk_printf(&trash, "\n%s%sFailed!\n", usermsgs_str(), ctx->err);
|
||||||
if (applet_putchk(appctx, &trash) == -1)
|
if (applet_putchk(appctx, &trash) == -1)
|
||||||
goto yield;
|
goto yield;
|
||||||
ctx->state = CERT_ST_FIN;
|
ctx->state = CERT_ST_FIN;
|
||||||
@ -2241,10 +2243,12 @@ static int cli_io_handler_commit_cert(struct appctx *appctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
|
usermsgs_clr(NULL);
|
||||||
/* success: call the release function and don't come back */
|
/* success: call the release function and don't come back */
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
yield:
|
yield:
|
||||||
|
usermsgs_clr(NULL);
|
||||||
return 0; /* should come back */
|
return 0; /* should come back */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user