/* a full logformat expr made of one or multiple logformat nodes */
struct lf_expr {
- struct list list; /* to store lf_expr inside a list */
+ struct list list; /* to store lf_expr inside a list */
union {
- struct list nodes; /* logformat_node list */
- char *str; /* original string prior to parsing (NULL once compiled) */
+ struct {
+ struct list list; /* logformat_node list */
+ } nodes;
+ char *str; /* original string prior to parsing (NULL once compiled) */
};
struct {
- char *file; /* file where the lft appears */
- int line; /* line where the lft appears */
+ char *file; /* file where the lft appears */
+ int line; /* line where the lft appears */
} conf; // parsing hints
uint8_t flags; /* LF_FL_* flags */
};
cfgerr++;
continue;
}
- node = LIST_NEXT(&rule->be.expr.nodes, struct logformat_node *, list);
+ node = LIST_NEXT(&rule->be.expr.nodes.list, struct logformat_node *, list);
if (!lf_expr_isempty(&rule->be.expr)) {
- if (node->type != LOG_FMT_TEXT || node->list.n != &rule->be.expr.nodes) {
+ if (node->type != LOG_FMT_TEXT || node->list.n != &rule->be.expr.nodes.list) {
rule->dynamic = 1;
free(pxname);
/* backend is not yet known so we cannot assume its type,
cfgerr++;
continue;
}
- node = LIST_NEXT(&srule->expr.nodes, struct logformat_node *, list);
+ node = LIST_NEXT(&srule->expr.nodes.list, struct logformat_node *, list);
if (!lf_expr_isempty(&srule->expr)) {
- if (node->type != LOG_FMT_TEXT || node->list.n != &srule->expr.nodes) {
+ if (node->type != LOG_FMT_TEXT || node->list.n != &srule->expr.nodes.list) {
srule->dynamic = 1;
free(server_name);
continue;
int *defoptions, char **err)
{
int j;
- struct list *list_format= &lf_expr->nodes;
+ struct list *list_format= &lf_expr->nodes.list;
struct logformat_node *node = NULL;
for (j = 0; logformat_tags[j].name; j++) { // search a log type
*/
int add_to_logformat_list(char *start, char *end, int type, struct lf_expr *lf_expr, char **err)
{
- struct list *list_format = &lf_expr->nodes;
+ struct list *list_format = &lf_expr->nodes.list;
char *str;
if (type == LF_TEXT) { /* type text */
struct arg_list *al, int options, int cap, char **err, char **endptr)
{
char *cmd[2];
- struct list *list_format = &lf_expr->nodes;
+ struct list *list_format = &lf_expr->nodes.list;
struct sample_expr *expr = NULL;
struct logformat_node *node = NULL;
int cmd_arg;
* been saved as local 'fmt' string pointer, so we must free it before
* returning.
*/
- LIST_INIT(&lf_expr->nodes);
+ LIST_INIT(&lf_expr->nodes.list);
/* we must set the compiled flag now for proper deinit in case of failure */
lf_expr->flags |= LF_FL_COMPILED;
if (!(px->flags & PR_FL_CHECKED))
px->to_log |= LW_INIT;
- list_for_each_entry(lf, &lf_expr->nodes, list) {
+ list_for_each_entry(lf, &lf_expr->nodes.list, list) {
if (lf->type == LOG_FMT_EXPR) {
struct sample_expr *expr = lf->expr;
uint8_t http_needed = !!(expr->fetch->use & SMP_USE_HTTP_ANY);
void lf_expr_deinit(struct lf_expr *expr)
{
if ((expr->flags & LF_FL_COMPILED))
- free_logformat_list(&expr->nodes);
+ free_logformat_list(&expr->nodes.list);
else
logformat_str_free(&expr->str);
free(expr->conf.file);
dst->conf.line = src->conf.line;
dst->flags |= LF_FL_COMPILED;
- LIST_INIT(&dst->nodes);
+ LIST_INIT(&dst->nodes.list);
- list_for_each_entry_safe(lf, lfb, &src->nodes, list) {
+ list_for_each_entry_safe(lf, lfb, &src->nodes.list, list) {
LIST_DELETE(&lf->list);
- LIST_APPEND(&dst->nodes, &lf->list);
+ LIST_APPEND(&dst->nodes.list, &lf->list);
}
/* replace <src> with <dst> in <src>'s list by first adding
struct http_txn *txn;
const struct strm_logs *logs;
struct connection *fe_conn, *be_conn;
- struct list *list_format = &lf_expr->nodes;
+ struct list *list_format = &lf_expr->nodes.list;
unsigned int s_flags;
unsigned int uniq_id;
struct buffer chunk;