]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] config: add pointer to file name in block/redirect/use_backend/monitor rules
authorWilly Tarreau <w@1wt.eu>
Sun, 4 Oct 2009 20:02:50 +0000 (22:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 4 Oct 2009 20:02:50 +0000 (22:02 +0200)
Those conditions already referenced the config line, but not the file.

include/types/acl.h
src/cfgparse.c

index 431e22b44ab290a679e8f49f53869333ae5493ca..aff330ea691773adcc0a273b587dc5d35220a6f3 100644 (file)
@@ -1,23 +1,23 @@
 /*
-  include/types/acl.h
-  This file provides structures and types for ACLs.
-
 Copyright (C) 2000-2008 Willy Tarreau - w@1wt.eu
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation, version 2.1
-  exclusively.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
* include/types/acl.h
* This file provides structures and types for ACLs.
+ *
* Copyright (C) 2000-2009 Willy Tarreau - w@1wt.eu
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, version 2.1
* exclusively.
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
 #ifndef _TYPES_ACL_H
 #define _TYPES_ACL_H
@@ -320,6 +320,7 @@ struct acl_cond {
        struct list suites;         /* list of acl_term_suites */
        int pol;                    /* polarity: ACL_COND_IF / ACL_COND_UNLESS */
        unsigned int requires;      /* or'ed bit mask of all acl's ACL_USE_* */
+       const char *file;           /* config file where the condition is declared */
        int line;                   /* line in the config file where the condition is declared */
 };
 
index 8e582a6278cfd17021815c91c8621ef3de4760cc..e65f59db04ba1518e2f96f4884fe8d88e460b28a 100644 (file)
@@ -1661,6 +1661,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                        err_code |= ERR_ALERT | ERR_FATAL;
                        goto out;
                }
+               cond->file = file;
                cond->line = linenum;
                curproxy->acl_requires |= cond->requires;
                LIST_ADDQ(&curproxy->block_cond, &cond->list);
@@ -1787,6 +1788,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                        goto out;
                }
 
+               cond->file = file;
                cond->line = linenum;
                curproxy->acl_requires |= cond->requires;
                rule = (struct redirect_rule *)calloc(1, sizeof(*rule));
@@ -1853,6 +1855,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                        goto out;
                }
 
+               cond->file = file;
                cond->line = linenum;
                curproxy->acl_requires |= cond->requires;
                if (cond->requires & ACL_USE_RTR_ANY) {
@@ -2339,6 +2342,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                                err_code |= ERR_ALERT | ERR_FATAL;
                                goto out;
                        }
+                       cond->file = file;
                        cond->line = linenum;
                        curproxy->acl_requires |= cond->requires;
                        LIST_ADDQ(&curproxy->mon_fail_cond, &cond->list);