mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
MINOR: filters: Print the list of existing filters during HA startup
This is done in verbose/debug mode and when build options are reported.
This commit is contained in:
parent
d50b4ac0d4
commit
b3f4e14932
@ -126,6 +126,7 @@ int flt_xfer_data(struct stream *s, struct channel *chn, unsigned int an_bit);
|
|||||||
void flt_register_keywords(struct flt_kw_list *kwl);
|
void flt_register_keywords(struct flt_kw_list *kwl);
|
||||||
struct flt_kw *flt_find_kw(const char *kw);
|
struct flt_kw *flt_find_kw(const char *kw);
|
||||||
void flt_dump_kws(char **out);
|
void flt_dump_kws(char **out);
|
||||||
|
void list_filters(FILE *out);
|
||||||
|
|
||||||
/* Helper function that returns the "global" state of filters attached to a
|
/* Helper function that returns the "global" state of filters attached to a
|
||||||
* stream. */
|
* stream. */
|
||||||
|
@ -33,10 +33,7 @@ struct filter;
|
|||||||
|
|
||||||
/* Descriptor for a "filter" keyword. The ->parse() function returns 0 in case
|
/* Descriptor for a "filter" keyword. The ->parse() function returns 0 in case
|
||||||
* of success, or a combination of ERR_* flags if an error is encountered. The
|
* of success, or a combination of ERR_* flags if an error is encountered. The
|
||||||
* function pointer can be NULL if not implemented. The function also has an
|
* function pointer can be NULL if not implemented.
|
||||||
* access to the current "server" config line. The ->skip value tells the parser
|
|
||||||
* how many words have to be skipped after the keyword. If the function needs to
|
|
||||||
* parse more keywords, it needs to update cur_arg.
|
|
||||||
*/
|
*/
|
||||||
struct flt_kw {
|
struct flt_kw {
|
||||||
const char *kw;
|
const char *kw;
|
||||||
|
@ -150,6 +150,21 @@ flt_dump_kws(char **out)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Lists the known filters on <out>
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
list_filters(FILE *out)
|
||||||
|
{
|
||||||
|
char *filters, *p, *f;
|
||||||
|
|
||||||
|
fprintf(out, "Available filters :\n");
|
||||||
|
flt_dump_kws(&filters);
|
||||||
|
for (p = filters; (f = strtok_r(p,"\n",&p));)
|
||||||
|
fprintf(out, "\t%s\n", f);
|
||||||
|
free(filters);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parses the "filter" keyword. All keywords must be handled by filters
|
* Parses the "filter" keyword. All keywords must be handled by filters
|
||||||
* themselves
|
* themselves
|
||||||
|
@ -412,6 +412,8 @@ void display_build_opts()
|
|||||||
|
|
||||||
list_pollers(stdout);
|
list_pollers(stdout);
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
|
list_filters(stdout);
|
||||||
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1126,8 +1128,11 @@ void init(int argc, char **argv)
|
|||||||
|
|
||||||
/* Note: we could disable any poller by name here */
|
/* Note: we could disable any poller by name here */
|
||||||
|
|
||||||
if (global.mode & (MODE_VERBOSE|MODE_DEBUG))
|
if (global.mode & (MODE_VERBOSE|MODE_DEBUG)) {
|
||||||
list_pollers(stderr);
|
list_pollers(stderr);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
list_filters(stderr);
|
||||||
|
}
|
||||||
|
|
||||||
if (!init_pollers()) {
|
if (!init_pollers()) {
|
||||||
Alert("No polling mechanism available.\n"
|
Alert("No polling mechanism available.\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user