From f268ee8795dcf8d6513c32eaf7031690c1b18233 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 4 Jun 2020 17:05:57 +0200 Subject: [PATCH] REORG: include: split global.h into haproxy/global{,-t}.h global.h was one of the messiest files, it has accumulated tons of implicit dependencies and declares many globals that make almost all other file include it. It managed to silence a dependency loop between server.h and proxy.h by being well placed to pre-define the required structs, forcing struct proxy and struct server to be forward-declared in a significant number of files. It was split in to, one which is the global struct definition and the few macros and flags, and the rest containing the functions prototypes. The UNIX_MAX_PATH definition was moved to compat.h. --- contrib/modsecurity/modsec_wrapper.c | 2 +- .../prometheus-exporter/service-prometheus.c | 3 +- include/haproxy/compat.h | 5 + include/haproxy/dns-t.h | 3 +- .../{types/global.h => haproxy/global-t.h} | 160 +++--------------- include/haproxy/global.h | 156 +++++++++++++++++ include/haproxy/lb_chash.h | 4 +- include/proto/channel.h | 2 +- include/proto/cli.h | 2 +- include/proto/proxy.h | 2 +- include/proto/session.h | 2 +- include/proto/task.h | 2 +- include/types/checks.h | 4 +- include/types/server.h | 2 +- include/types/session.h | 2 +- src/51d.c | 2 +- src/acl.c | 2 +- src/arg.c | 2 +- src/auth.c | 2 +- src/backend.c | 2 +- src/buffer.c | 2 +- src/cfgparse.c | 2 +- src/checks.c | 2 +- src/chunk.c | 2 +- src/cli.c | 2 +- src/compression.c | 2 +- src/da.c | 2 +- src/debug.c | 2 +- src/dns.c | 2 +- src/ev_epoll.c | 3 +- src/ev_evports.c | 2 +- src/ev_kqueue.c | 2 +- src/ev_poll.c | 2 +- src/ev_select.c | 2 +- src/fcgi-app.c | 2 +- src/fd.c | 2 +- src/flt_spoe.c | 2 +- src/flt_trace.c | 2 +- src/frontend.c | 2 +- src/h2.c | 2 +- src/haproxy.c | 2 +- src/hpack-dec.c | 2 - src/hpack-enc.c | 2 - src/hpack-tbl.c | 2 - src/http_acl.c | 2 - src/http_act.c | 2 +- src/http_conv.c | 1 - src/http_fetch.c | 3 +- src/http_htx.c | 2 +- src/http_rules.c | 1 - src/lb_chash.c | 1 - src/lb_fas.c | 1 - src/lb_fwlc.c | 1 - src/lb_fwrr.c | 1 - src/lb_map.c | 1 - src/listener.c | 2 +- src/log.c | 2 +- src/map.c | 1 - src/mworker.c | 2 +- src/namespace.c | 1 - src/pattern.c | 3 +- src/peers.c | 1 - src/pipe.c | 2 +- src/pool.c | 2 +- src/proto_sockpair.c | 3 +- src/proto_tcp.c | 2 +- src/proto_udp.c | 1 - src/proto_uxst.c | 3 +- src/proxy.c | 2 +- src/raw_sock.c | 3 +- src/regex.c | 1 - src/sample.c | 2 +- src/server.c | 2 +- src/session.c | 2 +- src/shctx.c | 1 - src/ssl_sock.c | 2 +- src/stats.c | 2 +- src/stick_table.c | 2 +- src/stream.c | 2 +- src/tcp_rules.c | 2 +- src/thread.c | 2 +- src/tools.c | 2 +- src/wdt.c | 2 +- src/wurfl.c | 2 +- 84 files changed, 246 insertions(+), 236 deletions(-) rename include/{types/global.h => haproxy/global-t.h} (60%) create mode 100644 include/haproxy/global.h diff --git a/contrib/modsecurity/modsec_wrapper.c b/contrib/modsecurity/modsec_wrapper.c index 8b9d998dd..9aec53888 100644 --- a/contrib/modsecurity/modsec_wrapper.c +++ b/contrib/modsecurity/modsec_wrapper.c @@ -16,10 +16,10 @@ #include #include +#include #include #include -#include #include #include diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c index fa36aa7f0..ed27bc49e 100644 --- a/contrib/prometheus-exporter/service-prometheus.c +++ b/contrib/prometheus-exporter/service-prometheus.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -24,8 +25,6 @@ #include #include -#include - #include #include #include diff --git a/include/haproxy/compat.h b/include/haproxy/compat.h index 251dfb202..fdd6fa4cd 100644 --- a/include/haproxy/compat.h +++ b/include/haproxy/compat.h @@ -108,6 +108,11 @@ typedef struct { } empty_t; #define MAXPATHLEN 128 #endif +/* longest UNIX socket name */ +#ifndef UNIX_MAX_PATH +#define UNIX_MAX_PATH 108 +#endif + /* On Linux, allows pipes to be resized */ #ifndef F_SETPIPE_SZ #define F_SETPIPE_SZ (1024 + 7) diff --git a/include/haproxy/dns-t.h b/include/haproxy/dns-t.h index fe3938a8c..54c58ee6c 100644 --- a/include/haproxy/dns-t.h +++ b/include/haproxy/dns-t.h @@ -30,8 +30,6 @@ #include #include -#include -#include #include extern struct pool_head *dns_requester_pool; @@ -346,6 +344,7 @@ enum { DNS_UPD_OBSOLETE_IP, /* The server IP was obsolete, and no other IP was found */ }; +struct proxy; struct dns_srvrq { enum obj_type obj_type; /* object type == OBJ_TYPE_SRVRQ */ struct dns_resolvers *resolvers; /* pointer to the resolvers structure used for this server template */ diff --git a/include/types/global.h b/include/haproxy/global-t.h similarity index 60% rename from include/types/global.h rename to include/haproxy/global-t.h index 56e7678a1..bee8de7a9 100644 --- a/include/types/global.h +++ b/include/haproxy/global-t.h @@ -1,8 +1,8 @@ /* - * include/types/global.h - * Global variables. + * include/haproxy/global-t.h + * Global types and macros. Please avoid adding more stuff here! * - * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu + * Copyright (C) 2000-2020 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 @@ -19,22 +19,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _TYPES_GLOBAL_H -#define _TYPES_GLOBAL_H - -#include - -#include -#include -#include +#ifndef _HAPROXY_GLOBAL_T_H +#define _HAPROXY_GLOBAL_T_H +#include #include -#include -#include - -#ifndef UNIX_MAX_PATH -#define UNIX_MAX_PATH 108 -#endif +#include +#include +#include +#include /* modes of operation (global.mode) */ #define MODE_DEBUG 0x01 @@ -82,6 +75,14 @@ enum { SSL_SERVER_VERIFY_REQUIRED = 1, }; +/* bit values to go with "warned" above */ +#define WARN_ANY 0x00000001 /* any warning was emitted */ +#define WARN_FORCECLOSE_DEPRECATED 0x00000002 +#define WARN_EXEC_PATH 0x00000004 /* executable path already reported */ + +/* put there the forward declarations needed for global.h */ +struct proxy; + /* FIXME : this will have to be redefined correctly */ struct global { int uid; @@ -180,130 +181,7 @@ struct global { #endif }; -extern struct global global; -extern int pid; /* current process id */ -extern int relative_pid; /* process id starting at 1 */ -extern unsigned long pid_bit; /* bit corresponding to the process id */ -extern unsigned long all_proc_mask; /* mask of all processes */ -extern int actconn; /* # of active sessions */ -extern int listeners; -extern int jobs; /* # of active jobs (listeners, sessions, open devices) */ -extern int unstoppable_jobs; /* # of active jobs that can't be stopped during a soft stop */ -extern int active_peers; /* # of active peers (connection attempts and successes) */ -extern int connected_peers; /* # of really connected peers */ -extern THREAD_LOCAL struct buffer trash; -extern int nb_oldpids; /* contains the number of old pids found */ -extern const int zero; -extern const int one; -extern const struct linger nolinger; -extern int stopping; /* non zero means stopping in progress */ -extern int killed; /* >0 means a hard-stop is triggered, >1 means hard-stop immediately */ -extern char hostname[MAX_HOSTNAME_LEN]; -extern char localpeer[MAX_HOSTNAME_LEN]; -extern unsigned int warned; /* bitfield of a few warnings to emit just once */ -extern volatile unsigned long sleeping_thread_mask; -extern struct list proc_list; /* list of process in mworker mode */ -extern struct mworker_proc *proc_self; /* process structure of current process */ -extern int master; /* 1 if in master, 0 otherwise */ -extern unsigned int rlim_fd_cur_at_boot; -extern unsigned int rlim_fd_max_at_boot; -extern int atexit_flag; -extern unsigned char boot_seed[20]; // per-boot random seed (160 bits initially) - -/* bit values to go with "warned" above */ -#define WARN_ANY 0x00000001 /* any warning was emitted */ -#define WARN_FORCECLOSE_DEPRECATED 0x00000002 -#define WARN_EXEC_PATH 0x00000004 /* executable path already reported */ - - -/* to be used with warned and WARN_* */ -static inline int already_warned(unsigned int warning) -{ - if (warned & warning) - return 1; - warned |= warning; - return 0; -} - -/* returns a mask if set, otherwise all_proc_mask */ -static inline unsigned long proc_mask(unsigned long mask) -{ - return mask ? mask : all_proc_mask; -} - -/* returns a mask if set, otherwise all_threads_mask */ -static inline unsigned long thread_mask(unsigned long mask) -{ - return mask ? mask : all_threads_mask; -} - -int tell_old_pids(int sig); -int delete_oldpid(int pid); - -int main(int argc, char **argv); -void deinit(void); -void run_poll_loop(void); -void hap_register_build_opts(const char *str, int must_free); -void hap_register_post_check(int (*fct)()); -void hap_register_post_proxy_check(int (*fct)(struct proxy *)); -void hap_register_post_server_check(int (*fct)(struct server *)); -void hap_register_post_deinit(void (*fct)()); -void hap_register_proxy_deinit(void (*fct)(struct proxy *)); -void hap_register_server_deinit(void (*fct)(struct server *)); - -void hap_register_per_thread_alloc(int (*fct)()); -void hap_register_per_thread_init(int (*fct)()); -void hap_register_per_thread_deinit(void (*fct)()); -void hap_register_per_thread_free(int (*fct)()); - -void mworker_accept_wrapper(int fd); -void mworker_reload(); - -/* simplified way to declare static build options in a file */ -#define REGISTER_BUILD_OPTS(str) \ - INITCALL2(STG_REGISTER, hap_register_build_opts, (str), 0) - -/* simplified way to declare a post-check callback in a file */ -#define REGISTER_POST_CHECK(fct) \ - INITCALL1(STG_REGISTER, hap_register_post_check, (fct)) - -/* simplified way to declare a post-proxy-check callback in a file */ -#define REGISTER_POST_PROXY_CHECK(fct) \ - INITCALL1(STG_REGISTER, hap_register_post_proxy_check, (fct)) - -/* simplified way to declare a post-server-check callback in a file */ -#define REGISTER_POST_SERVER_CHECK(fct) \ - INITCALL1(STG_REGISTER, hap_register_post_server_check, (fct)) - -/* simplified way to declare a post-deinit callback in a file */ -#define REGISTER_POST_DEINIT(fct) \ - INITCALL1(STG_REGISTER, hap_register_post_deinit, (fct)) - -/* simplified way to declare a proxy-deinit callback in a file */ -#define REGISTER_PROXY_DEINIT(fct) \ - INITCALL1(STG_REGISTER, hap_register_proxy_deinit, (fct)) - -/* simplified way to declare a proxy-deinit callback in a file */ -#define REGISTER_SERVER_DEINIT(fct) \ - INITCALL1(STG_REGISTER, hap_register_server_deinit, (fct)) - -/* simplified way to declare a per-thread allocation callback in a file */ -#define REGISTER_PER_THREAD_ALLOC(fct) \ - INITCALL1(STG_REGISTER, hap_register_per_thread_alloc, (fct)) - -/* simplified way to declare a per-thread init callback in a file */ -#define REGISTER_PER_THREAD_INIT(fct) \ - INITCALL1(STG_REGISTER, hap_register_per_thread_init, (fct)) - -/* simplified way to declare a per-thread deinit callback in a file */ -#define REGISTER_PER_THREAD_DEINIT(fct) \ - INITCALL1(STG_REGISTER, hap_register_per_thread_deinit, (fct)) - -/* simplified way to declare a per-thread free callback in a file */ -#define REGISTER_PER_THREAD_FREE(fct) \ - INITCALL1(STG_REGISTER, hap_register_per_thread_free, (fct)) - -#endif /* _TYPES_GLOBAL_H */ +#endif /* _HAPROXY_GLOBAL_T_H */ /* * Local variables: diff --git a/include/haproxy/global.h b/include/haproxy/global.h new file mode 100644 index 000000000..a3f952cb3 --- /dev/null +++ b/include/haproxy/global.h @@ -0,0 +1,156 @@ +/* + * include/haproxy/global.h + * Exported global variables and functions. + * + * Copyright (C) 2000-2020 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 _HAPROXY_GLOBAL_H +#define _HAPROXY_GLOBAL_H + +#include +#include +#include +#include +#include + +#include + +extern struct global global; +extern int pid; /* current process id */ +extern int relative_pid; /* process id starting at 1 */ +extern unsigned long pid_bit; /* bit corresponding to the process id */ +extern unsigned long all_proc_mask; /* mask of all processes */ +extern int actconn; /* # of active sessions */ +extern int listeners; +extern int jobs; /* # of active jobs (listeners, sessions, open devices) */ +extern int unstoppable_jobs; /* # of active jobs that can't be stopped during a soft stop */ +extern int active_peers; /* # of active peers (connection attempts and successes) */ +extern int connected_peers; /* # of really connected peers */ +extern int nb_oldpids; /* contains the number of old pids found */ +extern const int zero; +extern const int one; +extern const struct linger nolinger; +extern int stopping; /* non zero means stopping in progress */ +extern int killed; /* >0 means a hard-stop is triggered, >1 means hard-stop immediately */ +extern char hostname[MAX_HOSTNAME_LEN]; +extern char localpeer[MAX_HOSTNAME_LEN]; +extern unsigned int warned; /* bitfield of a few warnings to emit just once */ +extern volatile unsigned long sleeping_thread_mask; +extern struct list proc_list; /* list of process in mworker mode */ +extern struct mworker_proc *proc_self; /* process structure of current process */ +extern int master; /* 1 if in master, 0 otherwise */ +extern unsigned int rlim_fd_cur_at_boot; +extern unsigned int rlim_fd_max_at_boot; +extern int atexit_flag; +extern unsigned char boot_seed[20]; // per-boot random seed (160 bits initially) +extern THREAD_LOCAL struct buffer trash; + +int main(int argc, char **argv); +void deinit(void); +void run_poll_loop(void); +int tell_old_pids(int sig); +int delete_oldpid(int pid); +void hap_register_build_opts(const char *str, int must_free); +void hap_register_post_check(int (*fct)()); +void hap_register_post_proxy_check(int (*fct)(struct proxy *)); +void hap_register_post_server_check(int (*fct)(struct server *)); +void hap_register_post_deinit(void (*fct)()); +void hap_register_proxy_deinit(void (*fct)(struct proxy *)); +void hap_register_server_deinit(void (*fct)(struct server *)); + +void hap_register_per_thread_alloc(int (*fct)()); +void hap_register_per_thread_init(int (*fct)()); +void hap_register_per_thread_deinit(void (*fct)()); +void hap_register_per_thread_free(int (*fct)()); + +void mworker_accept_wrapper(int fd); +void mworker_reload(); + +/* to be used with warned and WARN_* */ +static inline int already_warned(unsigned int warning) +{ + if (warned & warning) + return 1; + warned |= warning; + return 0; +} + +/* returns a mask if set, otherwise all_proc_mask */ +static inline unsigned long proc_mask(unsigned long mask) +{ + return mask ? mask : all_proc_mask; +} + +/* returns a mask if set, otherwise all_threads_mask */ +static inline unsigned long thread_mask(unsigned long mask) +{ + return mask ? mask : all_threads_mask; +} + +/* simplified way to declare static build options in a file */ +#define REGISTER_BUILD_OPTS(str) \ + INITCALL2(STG_REGISTER, hap_register_build_opts, (str), 0) + +/* simplified way to declare a post-check callback in a file */ +#define REGISTER_POST_CHECK(fct) \ + INITCALL1(STG_REGISTER, hap_register_post_check, (fct)) + +/* simplified way to declare a post-proxy-check callback in a file */ +#define REGISTER_POST_PROXY_CHECK(fct) \ + INITCALL1(STG_REGISTER, hap_register_post_proxy_check, (fct)) + +/* simplified way to declare a post-server-check callback in a file */ +#define REGISTER_POST_SERVER_CHECK(fct) \ + INITCALL1(STG_REGISTER, hap_register_post_server_check, (fct)) + +/* simplified way to declare a post-deinit callback in a file */ +#define REGISTER_POST_DEINIT(fct) \ + INITCALL1(STG_REGISTER, hap_register_post_deinit, (fct)) + +/* simplified way to declare a proxy-deinit callback in a file */ +#define REGISTER_PROXY_DEINIT(fct) \ + INITCALL1(STG_REGISTER, hap_register_proxy_deinit, (fct)) + +/* simplified way to declare a proxy-deinit callback in a file */ +#define REGISTER_SERVER_DEINIT(fct) \ + INITCALL1(STG_REGISTER, hap_register_server_deinit, (fct)) + +/* simplified way to declare a per-thread allocation callback in a file */ +#define REGISTER_PER_THREAD_ALLOC(fct) \ + INITCALL1(STG_REGISTER, hap_register_per_thread_alloc, (fct)) + +/* simplified way to declare a per-thread init callback in a file */ +#define REGISTER_PER_THREAD_INIT(fct) \ + INITCALL1(STG_REGISTER, hap_register_per_thread_init, (fct)) + +/* simplified way to declare a per-thread deinit callback in a file */ +#define REGISTER_PER_THREAD_DEINIT(fct) \ + INITCALL1(STG_REGISTER, hap_register_per_thread_deinit, (fct)) + +/* simplified way to declare a per-thread free callback in a file */ +#define REGISTER_PER_THREAD_FREE(fct) \ + INITCALL1(STG_REGISTER, hap_register_per_thread_free, (fct)) + +#endif /* _HAPROXY_GLOBAL_H */ + +/* + * Local variables: + * c-indent-level: 8 + * c-basic-offset: 8 + * End: + */ diff --git a/include/haproxy/lb_chash.h b/include/haproxy/lb_chash.h index 0d6410d40..77d790fbe 100644 --- a/include/haproxy/lb_chash.h +++ b/include/haproxy/lb_chash.h @@ -24,9 +24,9 @@ #include #include -#include -#include +struct proxy; +struct server; void chash_init_server_tree(struct proxy *p); struct server *chash_get_next_server(struct proxy *p, struct server *srvtoavoid); struct server *chash_get_server_hash(struct proxy *p, unsigned int hash, const struct server *avoid); diff --git a/include/proto/channel.h b/include/proto/channel.h index d391a4ae0..354758188 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -30,12 +30,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/include/proto/cli.h b/include/proto/cli.h index 0668508ff..13490afb2 100644 --- a/include/proto/cli.h +++ b/include/proto/cli.h @@ -23,10 +23,10 @@ #ifndef _PROTO_CLI_H #define _PROTO_CLI_H +#include #include #include #include -#include #include diff --git a/include/proto/proxy.h b/include/proto/proxy.h index 5e17ffe55..6a9aa555c 100644 --- a/include/proto/proxy.h +++ b/include/proto/proxy.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/proto/session.h b/include/proto/session.h index 8a17ad91d..01e2d94a7 100644 --- a/include/proto/session.h +++ b/include/proto/session.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/include/proto/task.h b/include/proto/task.h index 17a828813..85ec75a65 100644 --- a/include/proto/task.h +++ b/include/proto/task.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -35,7 +36,6 @@ #include #include -#include #include #include diff --git a/include/types/checks.h b/include/types/checks.h index 9b914d00d..371ed431c 100644 --- a/include/types/checks.h +++ b/include/types/checks.h @@ -23,9 +23,7 @@ #include #include -#include #include -#include #include #include @@ -133,6 +131,8 @@ enum { HANA_OBS_SIZE }; +struct proxy; +struct server; struct check { enum obj_type obj_type; /* object type == OBJ_TYPE_CHECK */ struct session *sess; /* Health check session. */ diff --git a/include/types/server.h b/include/types/server.h index 770a472e5..a9d333e17 100644 --- a/include/types/server.h +++ b/include/types/server.h @@ -38,7 +38,6 @@ #include #include -#include #include #include #include @@ -204,6 +203,7 @@ struct tree_occ { struct eb32_node node; }; +struct proxy; struct server { enum obj_type obj_type; /* object type == OBJ_TYPE_SERVER */ enum srv_state next_state, cur_state; /* server state among SRV_ST_* */ diff --git a/include/types/session.h b/include/types/session.h index 70d10a84c..3e49b461b 100644 --- a/include/types/session.h +++ b/include/types/session.h @@ -33,7 +33,6 @@ #include #include -#include #include #include @@ -51,6 +50,7 @@ enum { SESS_FL_PREFER_LAST = 0x00000001, /* NTML authent, we should reuse last conn */ }; +struct proxy; struct session { struct proxy *fe; /* the proxy this session depends on for the client side */ struct listener *listener; /* the listener by which the request arrived */ diff --git a/src/51d.c b/src/51d.c index 2309592dd..529a8baa0 100644 --- a/src/51d.c +++ b/src/51d.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/acl.c b/src/acl.c index d2187e8e5..caa9dd152 100644 --- a/src/acl.c +++ b/src/acl.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/src/arg.c b/src/arg.c index 467929b52..a0f9a5972 100644 --- a/src/arg.c +++ b/src/arg.c @@ -16,7 +16,7 @@ #include #include -#include +#include #include const char *arg_type_names[ARGT_NBTYPES] = { diff --git a/src/auth.c b/src/auth.c index b28d6dd78..fe21a458d 100644 --- a/src/auth.c +++ b/src/auth.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/backend.c b/src/backend.c index e12f207e4..18ac58306 100644 --- a/src/backend.c +++ b/src/backend.c @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include diff --git a/src/buffer.c b/src/buffer.c index b41716b7e..e0db429c0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -19,7 +19,7 @@ #include #include -#include +#include struct pool_head *pool_head_buffer; diff --git a/src/cfgparse.c b/src/cfgparse.c index 6c675c4b8..8ea64a199 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -58,7 +58,7 @@ #include #include -#include +#include #include #include diff --git a/src/checks.c b/src/checks.c index 0793a82a2..af34ebebb 100644 --- a/src/checks.c +++ b/src/checks.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include diff --git a/src/chunk.c b/src/chunk.c index f9e6fe5d2..6f9aa39b3 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -19,7 +19,7 @@ #include #include -#include +#include /* trash chunks used for various conversions */ static THREAD_LOCAL struct buffer *trash_chunk; diff --git a/src/cli.c b/src/cli.c index f5f197f97..b9481c1f1 100644 --- a/src/cli.c +++ b/src/cli.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include diff --git a/src/compression.c b/src/compression.c index 77da4057a..081bf03be 100644 --- a/src/compression.c +++ b/src/compression.c @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include diff --git a/src/da.c b/src/da.c index aef12a2fe..20afdfc67 100644 --- a/src/da.c +++ b/src/da.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/debug.c b/src/debug.c index 18fed0162..c17965246 100644 --- a/src/debug.c +++ b/src/debug.c @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include diff --git a/src/dns.c b/src/dns.c index a3e02e9d1..4fec311d2 100644 --- a/src/dns.c +++ b/src/dns.c @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include diff --git a/src/ev_epoll.c b/src/ev_epoll.c index d5717e74c..0a12262c8 100644 --- a/src/ev_epoll.c +++ b/src/ev_epoll.c @@ -15,13 +15,12 @@ #include #include +#include #include #include #include #include -#include - #include #include #include diff --git a/src/ev_evports.c b/src/ev_evports.c index 0a18bd3a7..cfd053bb7 100644 --- a/src/ev_evports.c +++ b/src/ev_evports.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c index 5746f1a2f..a4c3bce99 100644 --- a/src/ev_kqueue.c +++ b/src/ev_kqueue.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/src/ev_poll.c b/src/ev_poll.c index 344b6d4a1..8781e6c0d 100644 --- a/src/ev_poll.c +++ b/src/ev_poll.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/src/ev_select.c b/src/ev_select.c index 6a5d2f8b3..cee5e8e70 100644 --- a/src/ev_select.c +++ b/src/ev_select.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include diff --git a/src/fcgi-app.c b/src/fcgi-app.c index 6d02e897a..10a8de542 100644 --- a/src/fcgi-app.c +++ b/src/fcgi-app.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include diff --git a/src/fd.c b/src/fd.c index 60db19ccc..82f619625 100644 --- a/src/fd.c +++ b/src/fd.c @@ -89,7 +89,7 @@ #include -#include +#include #include #include diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 6acb9f412..64650ae52 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/src/flt_trace.c b/src/flt_trace.c index 362040c37..1c200cefc 100644 --- a/src/flt_trace.c +++ b/src/flt_trace.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/src/frontend.c b/src/frontend.c index 00c31d84e..44ac1514f 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include diff --git a/src/h2.c b/src/h2.c index 7e5811346..bd46ffca9 100644 --- a/src/h2.c +++ b/src/h2.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include struct h2_frame_definition h2_frame_definition[H2_FT_ENTRIES] = { [H2_FT_DATA ] = { .dir = 3, .min_id = 1, .max_id = H2_MAX_STREAM_ID, .min_len = 0, .max_len = H2_MAX_FRAME_LEN, }, diff --git a/src/haproxy.c b/src/haproxy.c index 5a7cbf35b..377bb2e59 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -110,7 +110,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/hpack-dec.c b/src/hpack-dec.c index c9808d362..987165c64 100644 --- a/src/hpack-dec.c +++ b/src/hpack-dec.c @@ -38,8 +38,6 @@ #include #include -#include - #if defined(DEBUG_HPACK) #define hpack_debug_printf printf diff --git a/src/hpack-enc.c b/src/hpack-enc.c index 62c665202..64cca7873 100644 --- a/src/hpack-enc.c +++ b/src/hpack-enc.c @@ -34,8 +34,6 @@ #include #include -#include - /* * HPACK encoding: these tables were generated using gen-enc.c */ diff --git a/src/hpack-tbl.c b/src/hpack-tbl.c index 8c56a0ddb..ac6408c2c 100644 --- a/src/hpack-tbl.c +++ b/src/hpack-tbl.c @@ -34,8 +34,6 @@ #include #include -#include - /* static header table as in RFC7541 Appendix A. [0] unused. */ const struct http_hdr hpack_sht[HPACK_SHT_SIZE] = { [ 1] = { .n = IST(":authority"), .v = IST("") }, diff --git a/src/http_acl.c b/src/http_acl.c index b2de967aa..0b6adfdb0 100644 --- a/src/http_acl.c +++ b/src/http_acl.c @@ -25,8 +25,6 @@ #include #include -#include - #include #include diff --git a/src/http_act.c b/src/http_act.c index 0549bc018..356d57287 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include -#include #include #include diff --git a/src/http_conv.c b/src/http_conv.c index 730809a9f..bee2f90ca 100644 --- a/src/http_conv.c +++ b/src/http_conv.c @@ -25,7 +25,6 @@ #include #include -#include #include #include diff --git a/src/http_fetch.c b/src/http_fetch.c index 634847aee..6f367fed7 100644 --- a/src/http_fetch.c +++ b/src/http_fetch.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -31,8 +32,6 @@ #include #include -#include - #include #include #include diff --git a/src/http_htx.c b/src/http_htx.c index d018ca5b0..35bb2c6ca 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -15,9 +15,9 @@ #include #include +#include #include #include -#include #include #include diff --git a/src/http_rules.c b/src/http_rules.c index 79c9936ff..955c04f78 100644 --- a/src/http_rules.c +++ b/src/http_rules.c @@ -27,7 +27,6 @@ #include #include -#include #include #include diff --git a/src/lb_chash.c b/src/lb_chash.c index 0fc18d92d..4cb97ada4 100644 --- a/src/lb_chash.c +++ b/src/lb_chash.c @@ -20,7 +20,6 @@ #include #include -#include #include #include diff --git a/src/lb_fas.c b/src/lb_fas.c index 72e9c9c03..ae1297ea1 100644 --- a/src/lb_fas.c +++ b/src/lb_fas.c @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/src/lb_fwlc.c b/src/lb_fwlc.c index b9cc9878b..3aa050f4e 100644 --- a/src/lb_fwlc.c +++ b/src/lb_fwlc.c @@ -13,7 +13,6 @@ #include #include -#include #include #include diff --git a/src/lb_fwrr.c b/src/lb_fwrr.c index 6f8769741..7eafe489a 100644 --- a/src/lb_fwrr.c +++ b/src/lb_fwrr.c @@ -13,7 +13,6 @@ #include #include -#include #include #include diff --git a/src/lb_map.c b/src/lb_map.c index 8d2461fcf..c5e0f89d6 100644 --- a/src/lb_map.c +++ b/src/lb_map.c @@ -13,7 +13,6 @@ #include #include -#include #include #include diff --git a/src/listener.c b/src/listener.c index 3f6230ffb..417a902b4 100644 --- a/src/listener.c +++ b/src/listener.c @@ -21,12 +21,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/src/log.c b/src/log.c index 2bc0990c3..d9bbecd73 100644 --- a/src/log.c +++ b/src/log.c @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include diff --git a/src/map.c b/src/map.c index 33f24dd9f..7435fb1bc 100644 --- a/src/map.c +++ b/src/map.c @@ -20,7 +20,6 @@ #include #include -#include #include #include diff --git a/src/mworker.c b/src/mworker.c index 4ba43d2d9..9e5b8260b 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/src/namespace.c b/src/namespace.c index 4f82c6203..616dbea11 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -16,7 +16,6 @@ #include #include #include -#include /* Opens the namespace and returns the FD or -1 in case of error * (check errno). diff --git a/src/pattern.c b/src/pattern.c index 93972341a..0ec22c10d 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -15,13 +15,12 @@ #include #include +#include #include #include #include #include -#include - #include #include diff --git a/src/peers.c b/src/peers.c index 8a07cdbf8..372434634 100644 --- a/src/peers.c +++ b/src/peers.c @@ -29,7 +29,6 @@ #include #include -#include #include #include diff --git a/src/pipe.c b/src/pipe.c index 992c77bd5..59b8312ce 100644 --- a/src/pipe.c +++ b/src/pipe.c @@ -14,10 +14,10 @@ #include #include +#include #include #include -#include #include DECLARE_STATIC_POOL(pool_head_pipe, "pipe", sizeof(struct pipe)); diff --git a/src/pool.c b/src/pool.c index 4ff97b660..2f32b5872 100644 --- a/src/pool.c +++ b/src/pool.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c index 7d7dce4e1..a0453c1bc 100644 --- a/src/proto_sockpair.c +++ b/src/proto_sockpair.c @@ -28,14 +28,13 @@ #include #include +#include #include #include #include #include #include -#include - #include #include #include diff --git a/src/proto_tcp.c b/src/proto_tcp.c index de001c2a5..e6eae9960 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -41,7 +42,6 @@ #include #include -#include #include #include diff --git a/src/proto_udp.c b/src/proto_udp.c index 93c03898f..617df1af1 100644 --- a/src/proto_udp.c +++ b/src/proto_udp.c @@ -10,7 +10,6 @@ * */ -#include #include #include diff --git a/src/proto_uxst.c b/src/proto_uxst.c index f0a38e7f6..69253732b 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -28,14 +28,13 @@ #include #include +#include #include #include #include #include #include -#include - #include #include #include diff --git a/src/proxy.c b/src/proxy.c index 2b5368d7d..5d422170f 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,6 @@ #include #include -#include #include #include diff --git a/src/raw_sock.c b/src/raw_sock.c index 1ece79b33..b5538d64e 100644 --- a/src/raw_sock.c +++ b/src/raw_sock.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -36,8 +37,6 @@ #include #include -#include - #if defined(USE_LINUX_SPLICE) diff --git a/src/regex.c b/src/regex.c index bebbaa798..b2f325d7a 100644 --- a/src/regex.c +++ b/src/regex.c @@ -15,7 +15,6 @@ #include #include -#include #include #include #include diff --git a/src/sample.c b/src/sample.c index ef798341e..828cf26f7 100644 --- a/src/sample.c +++ b/src/sample.c @@ -17,11 +17,11 @@ #include #include -#include #include #include #include +#include #include #include #include diff --git a/src/server.c b/src/server.c index ae4f044b7..ddc61873c 100644 --- a/src/server.c +++ b/src/server.c @@ -21,13 +21,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include diff --git a/src/session.c b/src/session.c index afbcf2be1..92041f5f5 100644 --- a/src/session.c +++ b/src/session.c @@ -11,12 +11,12 @@ */ #include +#include #include #include #include #include -#include #include #include diff --git a/src/shctx.c b/src/shctx.c index 1a38b9148..f4002a48e 100644 --- a/src/shctx.c +++ b/src/shctx.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 6d9d71323..c1f239a7a 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -66,7 +67,6 @@ #include #include -#include #include #include diff --git a/src/stats.c b/src/stats.c index 6e5393402..555b56140 100644 --- a/src/stats.c +++ b/src/stats.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,6 @@ #include #include -#include #include #include diff --git a/src/stick_table.c b/src/stick_table.c index 7026e39ca..638d30c57 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -27,7 +28,6 @@ #include #include -#include #include #include diff --git a/src/stream.c b/src/stream.c index 248dfe25a..3531e52ed 100644 --- a/src/stream.c +++ b/src/stream.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -33,7 +34,6 @@ #include #include #include -#include #include #include diff --git a/src/tcp_rules.c b/src/tcp_rules.c index 6a878fb7d..e2f8a2950 100644 --- a/src/tcp_rules.c +++ b/src/tcp_rules.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -21,7 +22,6 @@ #include #include -#include #include #include diff --git a/src/thread.c b/src/thread.c index 0ee9332d0..b0cbd3487 100644 --- a/src/thread.c +++ b/src/thread.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include struct thread_info ha_thread_info[MAX_THREADS] = { }; diff --git a/src/tools.c b/src/tools.c index cfec66a10..6dda8aa9a 100644 --- a/src/tools.c +++ b/src/tools.c @@ -42,11 +42,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/src/wdt.c b/src/wdt.c index 1248bebbb..93b32248c 100644 --- a/src/wdt.c +++ b/src/wdt.c @@ -14,9 +14,9 @@ #include #include +#include #include #include -#include #include #include diff --git a/src/wurfl.c b/src/wurfl.c index 43cedf510..bbc2f3d64 100644 --- a/src/wurfl.c +++ b/src/wurfl.c @@ -6,8 +6,8 @@ #include #include #include +#include #include -#include #include #include #include