BUG/MINOR: proxy/log: frontend/backend and log forward names must differ

This patch disallow to use same name for a log forward section
and a frontend/backend section.
This commit is contained in:
Emeric Brun
2020-10-07 17:05:59 +02:00
committed by Willy Tarreau
parent cbb7bf7dd1
commit b0c331f71f
3 changed files with 37 additions and 6 deletions

View File

@@ -169,6 +169,22 @@ static inline int build_logline(struct stream *s, char *dst, size_t maxsize, str
struct ist *build_log_header(enum log_fmt format, int level, int facility, struct ist *metadata, size_t *nbelem);
/*
* lookup log forward proxy by name
* Returns NULL if no proxy found.
*/
static inline struct proxy *log_forward_by_name(const char *name)
{
struct proxy *px = cfg_log_forward;
while (px) {
if (strcmp(px->id, name) == 0)
return px;
px = px->next;
}
return NULL;
}
#endif /* _HAPROXY_LOG_H */
/*