REORG: config: extract the proxy parser into cfgparse-listen.c
This was the largest function of the whole file, taking a rough second
to build alone. Let's move it to a distinct file along with a few
dependencies. Doing so saved about 2 seconds on the total build time.
diff --git a/include/common/cfgparse.h b/include/common/cfgparse.h
index 2ffcea0..3069722 100644
--- a/include/common/cfgparse.h
+++ b/include/common/cfgparse.h
@@ -82,19 +82,12 @@
int (*func)();
};
-/* some of the most common options which are also the easiest to handle */
-struct cfg_opt {
- const char *name;
- unsigned int val;
- unsigned int cap;
- unsigned int checks;
- unsigned int mode;
-};
-
extern int cfg_maxpconn;
extern int cfg_maxconn;
extern char *cfg_scope;
extern struct cfg_kw_list cfg_keywords;
+extern char *cursection;
+extern struct proxy defproxy;
int cfg_parse_global(const char *file, int linenum, char **args, int inv);
int cfg_parse_listen(const char *file, int linenum, char **args, int inv);
@@ -116,12 +109,14 @@
int warnif_misplaced_tcp_conn(struct proxy *proxy, const char *file, int line, const char *arg);
int warnif_misplaced_tcp_sess(struct proxy *proxy, const char *file, int line, const char *arg);
int warnif_misplaced_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg);
+int warnif_cond_conflicts(const struct acl_cond *cond, unsigned int where, const char *file, int line);
int too_many_args_idx(int maxarg, int index, char **args, char **msg, int *err_code);
int too_many_args(int maxarg, char **args, char **msg, int *err_code);
int alertif_too_many_args_idx(int maxarg, int index, const char *file, int linenum, char **args, int *err_code);
int alertif_too_many_args(int maxarg, const char *file, int linenum, char **args, int *err_code);
int parse_process_number(const char *arg, unsigned long *proc, int *autoinc, char **err);
unsigned long parse_cpu_set(const char **args, unsigned long *cpu_set, char **err);
+void free_email_alert(struct proxy *p);
/*
* Sends a warning if proxy <proxy> does not have at least one of the
diff --git a/include/proto/proxy.h b/include/proto/proxy.h
index 8965ec3..782372e 100644
--- a/include/proto/proxy.h
+++ b/include/proto/proxy.h
@@ -36,6 +36,9 @@
extern unsigned int error_snapshot_id; /* global ID assigned to each error then incremented */
extern struct eb_root proxy_by_name; /* tree of proxies sorted by name */
+extern const struct cfg_opt cfg_opts[];
+extern const struct cfg_opt cfg_opts2[];
+
int start_proxies(int verbose);
struct task *manage_proxy(struct task *t, void *context, unsigned short state);
void soft_stop(void);
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 8e181fa..357e0c1 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -516,6 +516,15 @@
char *cookie_str;
};
+/* some of the most common options which are also the easiest to handle */
+struct cfg_opt {
+ const char *name;
+ unsigned int val;
+ unsigned int cap;
+ unsigned int checks;
+ unsigned int mode;
+};
+
#endif /* _TYPES_PROXY_H */
/*