CLEANUP: peers/cli: stop misusing the appctx local variable

In the context of a CLI command, it's particularly not welcome to use
an "appctx" variable that is not the current one. In addition it was
created for use at exactly 6 places in 2 lines. Let's just remove it
and stick to peer->appctx which is used elsewhere in the function and
is unambiguous.
This commit is contained in:
Willy Tarreau 2022-05-31 08:53:25 +02:00
parent ccea010104
commit fc5059958f

View File

@ -3777,7 +3777,6 @@ static int peers_dump_peer(struct buffer *msg, struct stconn *sc, struct peer *p
char pn[INET6_ADDRSTRLEN];
struct stconn *peer_cs;
struct stream *peer_s;
struct appctx *appctx;
struct shared_table *st;
addr_to_str(&peer->addr, pn, sizeof pn);
@ -3810,12 +3809,12 @@ static int peers_dump_peer(struct buffer *msg, struct stconn *sc, struct peer *p
chunk_appendf(&trash, " flags=0x%x", peer->flags);
appctx = peer->appctx;
if (!appctx)
if (!peer->appctx)
goto table_info;
chunk_appendf(&trash, " appctx:%p st0=%d st1=%d task_calls=%u", appctx, appctx->st0, appctx->st1,
appctx->t ? appctx->t->calls : 0);
chunk_appendf(&trash, " appctx:%p st0=%d st1=%d task_calls=%u",
peer->appctx, peer->appctx->st0, peer->appctx->st1,
peer->appctx->t ? peer->appctx->t->calls : 0);
peer_cs = appctx_sc(peer->appctx);
peer_s = __sc_strm(peer_cs);