MINOR: spoe: Add a pointer on the filter config in the spoe_agent structure
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 2 Aug 2021 15:51:01 +0000 (17:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Aug 2021 15:03:33 +0000 (17:03 +0200)
There was no way to access the SPOE filter configuration from the agent
object. However it could be handy to have it. And in fact, this will be
required to fix a bug.

(cherry picked from commit 434b8525ee333f511b5461eae41b23842d3636d4)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 541e261ce3c1af30e172ab97d8ce8e865a941e77)
Signed-off-by: Willy Tarreau <w@1wt.eu>

include/haproxy/spoe-t.h
src/flt_spoe.c

index dbfe0cb..197f47b 100644 (file)
@@ -280,6 +280,7 @@ struct spoe_agent {
        } timeout;
 
        /* Config info */
+       struct spoe_config  *spoe_conf;       /* SPOE filter config */
        char                 *var_pfx;        /* Prefix used for vars set by the agent */
        char                 *var_on_error;   /* Variable to set when an error occurred, in the TXN scope */
        char                 *var_t_process;  /* Variable to set to report the processing time of the last event/group, in the TXN scope */
index 2accd8b..e8a696f 100644 (file)
@@ -4415,6 +4415,7 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px,
 
        conf->id    = strdup(engine ? engine : curagent->id);
        conf->agent = curagent;
+       curagent->spoe_conf = conf;
 
        /* Start agent's proxy initialization here. It will be finished during
         * the filter init. */