mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
MEDIUM: cli: rely on the map's output type instead of the sample type
Next patch will remove sample_storage->type, and the only user is the "show map" feature on the CLI which can use the map's output type instead. Let's do that first.
This commit is contained in:
parent
a123ad886a
commit
03d0e45dbb
@ -5619,6 +5619,11 @@ static int stats_map_lookup(struct stream_interface *si)
|
|||||||
appctx->ctx.map.expr = LIST_ELEM(&appctx->ctx.map.ref->pat, struct pattern_expr *, list);
|
appctx->ctx.map.expr = LIST_ELEM(&appctx->ctx.map.ref->pat, struct pattern_expr *, list);
|
||||||
appctx->ctx.map.expr = pat_expr_get_next(appctx->ctx.map.expr, &appctx->ctx.map.ref->pat);
|
appctx->ctx.map.expr = pat_expr_get_next(appctx->ctx.map.expr, &appctx->ctx.map.ref->pat);
|
||||||
appctx->st2 = STAT_ST_LIST;
|
appctx->st2 = STAT_ST_LIST;
|
||||||
|
|
||||||
|
/* retrieve one of the compatible map descriptor for learnig the type. */
|
||||||
|
if (appctx->ctx.map.display_flags == PAT_REF_MAP)
|
||||||
|
appctx->ctx.map.desc = container_of(appctx->ctx.map.expr->pat_head,
|
||||||
|
struct map_descriptor, pat);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
case STAT_ST_LIST:
|
case STAT_ST_LIST:
|
||||||
@ -5692,8 +5697,8 @@ static int stats_map_lookup(struct stream_interface *si)
|
|||||||
/* display return value */
|
/* display return value */
|
||||||
if (appctx->ctx.map.display_flags == PAT_REF_MAP) {
|
if (appctx->ctx.map.display_flags == PAT_REF_MAP) {
|
||||||
if (pat->smp && pat->ref && pat->ref->sample)
|
if (pat->smp && pat->ref && pat->ref->sample)
|
||||||
chunk_appendf(&trash, ", value=\"%s\", type=\"%s\"",
|
chunk_appendf(&trash, ", value=\"%s\", type=\"%s\"", pat->ref->sample,
|
||||||
pat->ref->sample, smp_to_type[pat->smp->type]);
|
smp_to_type[appctx->ctx.map.desc->conv->out_type]);
|
||||||
else
|
else
|
||||||
chunk_appendf(&trash, ", value=none");
|
chunk_appendf(&trash, ", value=none");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user