BUG/MINOR: httpclient/cli: change the appctx test in the callbacks

The callbacks of the CLI httpclient are testing the appctx pointer
before doing the appctx_wakeup but was dereferencing the appctx pointer
before.
This commit is contained in:
William Lallemand 2021-08-20 11:35:29 +02:00
parent b70203017b
commit dfc3f8906d

View File

@ -64,8 +64,10 @@ void hc_cli_res_stline_cb(struct httpclient *hc)
{ {
struct appctx *appctx = hc->caller; struct appctx *appctx = hc->caller;
if (!appctx)
return;
appctx->ctx.cli.i0 |= HC_CLI_F_RES_STLINE; appctx->ctx.cli.i0 |= HC_CLI_F_RES_STLINE;
if (appctx)
appctx_wakeup(appctx); appctx_wakeup(appctx);
} }
@ -73,8 +75,10 @@ void hc_cli_res_headers_cb(struct httpclient *hc)
{ {
struct appctx *appctx = hc->caller; struct appctx *appctx = hc->caller;
if (!appctx)
return;
appctx->ctx.cli.i0 |= HC_CLI_F_RES_HDR; appctx->ctx.cli.i0 |= HC_CLI_F_RES_HDR;
if (appctx)
appctx_wakeup(appctx); appctx_wakeup(appctx);
} }
@ -82,8 +86,10 @@ void hc_cli_res_body_cb(struct httpclient *hc)
{ {
struct appctx *appctx = hc->caller; struct appctx *appctx = hc->caller;
if (!appctx)
return;
appctx->ctx.cli.i0 |= HC_CLI_F_RES_BODY; appctx->ctx.cli.i0 |= HC_CLI_F_RES_BODY;
if (appctx)
appctx_wakeup(appctx); appctx_wakeup(appctx);
} }
@ -91,8 +97,10 @@ void hc_cli_res_end_cb(struct httpclient *hc)
{ {
struct appctx *appctx = hc->caller; struct appctx *appctx = hc->caller;
if (!appctx)
return;
appctx->ctx.cli.i0 |= HC_CLI_F_RES_END; appctx->ctx.cli.i0 |= HC_CLI_F_RES_END;
if (appctx)
appctx_wakeup(appctx); appctx_wakeup(appctx);
} }