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,36 +64,44 @@ void hc_cli_res_stline_cb(struct httpclient *hc)
{
struct appctx *appctx = hc->caller;
if (!appctx)
return;
appctx->ctx.cli.i0 |= HC_CLI_F_RES_STLINE;
if (appctx)
appctx_wakeup(appctx);
appctx_wakeup(appctx);
}
void hc_cli_res_headers_cb(struct httpclient *hc)
{
struct appctx *appctx = hc->caller;
if (!appctx)
return;
appctx->ctx.cli.i0 |= HC_CLI_F_RES_HDR;
if (appctx)
appctx_wakeup(appctx);
appctx_wakeup(appctx);
}
void hc_cli_res_body_cb(struct httpclient *hc)
{
struct appctx *appctx = hc->caller;
if (!appctx)
return;
appctx->ctx.cli.i0 |= HC_CLI_F_RES_BODY;
if (appctx)
appctx_wakeup(appctx);
appctx_wakeup(appctx);
}
void hc_cli_res_end_cb(struct httpclient *hc)
{
struct appctx *appctx = hc->caller;
if (!appctx)
return;
appctx->ctx.cli.i0 |= HC_CLI_F_RES_END;
if (appctx)
appctx_wakeup(appctx);
appctx_wakeup(appctx);
}
/*