From aeed4a85d6c95382f26ff34d9e944c71e21be711 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 4 Jun 2020 22:01:04 +0200 Subject: [PATCH] REORG: include: move log.h to haproxy/log{,-t}.h The current state of the logging is a real mess. The main problem is that almost all files include log.h just in order to have access to the alert/warning functions like ha_alert() etc, and don't care about logs. But log.h also deals with real logging as well as log-format and depends on stream.h and various other things. As such it forces a few heavy files like stream.h to be loaded early and to hide missing dependencies depending where it's loaded. Among the missing ones is syslog.h which was often automatically included resulting in no less than 3 users missing it. Among 76 users, only 5 could be removed, and probably 70 don't need the full set of dependencies. A good approach would consist in splitting that file in 3 parts: - one for error output ("errors" ?). - one for log_format processing - and one for actual logging. --- contrib/modsecurity/modsec_wrapper.c | 2 +- include/common/cfgparse.h | 3 +- include/haproxy/connection.h | 1 + include/haproxy/defaults.h | 5 + include/{types/log.h => haproxy/log-t.h} | 114 +++++++++++------------ include/{proto => haproxy}/log.h | 96 +++++++++---------- include/haproxy/trace.h | 1 - include/proto/server.h | 2 +- include/types/proxy.h | 1 - include/types/spoe.h | 1 - src/51d.c | 2 +- src/acl.c | 2 +- src/action.c | 2 +- src/auth.c | 3 +- src/backend.c | 2 +- src/cache.c | 2 +- src/cfgparse.c | 2 +- src/check.c | 3 +- src/cli.c | 2 +- src/da.c | 2 +- src/debug.c | 2 + src/dns.c | 2 +- src/ev_evports.c | 1 - src/fcgi-app.c | 2 +- src/fd.c | 1 - src/flt_spoe.c | 2 +- src/flt_trace.c | 2 +- src/frontend.c | 2 +- src/haproxy.c | 2 +- src/hlua_fcn.c | 1 + src/http_act.c | 1 - src/http_ana.c | 2 +- src/http_fetch.c | 1 - src/listener.c | 2 +- src/log.c | 3 +- src/map.c | 1 - src/mux_fcgi.c | 2 +- src/mux_h1.c | 2 +- src/mworker-prog.c | 2 +- src/mworker.c | 2 +- src/namespace.c | 2 +- src/pattern.c | 2 +- src/peers.c | 2 +- src/pool.c | 2 +- src/proto_sockpair.c | 2 +- src/proto_tcp.c | 2 +- src/proto_uxst.c | 2 +- src/proxy.c | 2 +- src/raw_sock.c | 2 +- src/regex.c | 2 +- src/sample.c | 2 +- src/session.c | 2 +- src/signal.c | 2 +- src/sink.c | 2 +- src/ssl_ckch.c | 1 + src/ssl_crtlist.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/trace.c | 2 +- src/uri_auth.c | 2 +- src/wdt.c | 2 +- src/wurfl.c | 2 +- 65 files changed, 161 insertions(+), 170 deletions(-) rename include/{types/log.h => haproxy/log-t.h} (69%) rename include/{proto => haproxy}/log.h (81%) diff --git a/contrib/modsecurity/modsec_wrapper.c b/contrib/modsecurity/modsec_wrapper.c index 9aec53888..740767454 100644 --- a/contrib/modsecurity/modsec_wrapper.c +++ b/contrib/modsecurity/modsec_wrapper.c @@ -18,12 +18,12 @@ #include #include +#include #include #include #include -#include #include #include diff --git a/include/common/cfgparse.h b/include/common/cfgparse.h index 86f87bf42..9dd636323 100644 --- a/include/common/cfgparse.h +++ b/include/common/cfgparse.h @@ -24,8 +24,7 @@ #include #include - -#include +#include #include /* configuration sections */ diff --git a/include/haproxy/connection.h b/include/haproxy/connection.h index 0c0404313..24cad0f80 100644 --- a/include/haproxy/connection.h +++ b/include/haproxy/connection.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/include/haproxy/defaults.h b/include/haproxy/defaults.h index e359a3ea2..ef393dcb3 100644 --- a/include/haproxy/defaults.h +++ b/include/haproxy/defaults.h @@ -74,6 +74,11 @@ #define MAX_SYSLOG_LEN 1024 #endif +/* 64kB to archive startup-logs seems way more than enough */ +#ifndef STARTUP_LOG_SIZE +#define STARTUP_LOG_SIZE 65536 +#endif + // maximum line size when parsing config #ifndef LINESIZE #define LINESIZE 2048 diff --git a/include/types/log.h b/include/haproxy/log-t.h similarity index 69% rename from include/types/log.h rename to include/haproxy/log-t.h index 28992db13..c3efa2c7d 100644 --- a/include/types/log.h +++ b/include/haproxy/log-t.h @@ -1,34 +1,36 @@ /* - include/types/log.h - This file contains definitions of log-related structures and macros. + * include/haproxy/log-t.h + * This file contains definitions of log-related structures and macros. + * + * 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 + */ - Copyright (C) 2000-2006 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_LOG_H -#define _TYPES_LOG_H +#ifndef _HAPROXY_LOG_T_H +#define _HAPROXY_LOG_T_H #include #include #include -#include -#include + #include #include +#include +#include + #define NB_LOG_FACILITIES 24 #define NB_LOG_LEVELS 8 @@ -36,13 +38,35 @@ #define SYSLOG_PORT 514 #define UNIQUEID_LEN 128 -/* 64kB to archive startup-logs seems way more than enough */ -#ifndef STARTUP_LOG_SIZE -#define STARTUP_LOG_SIZE 65536 -#endif +/* flags used in logformat_node->options */ +#define LOG_OPT_HEXA 0x00000001 +#define LOG_OPT_MANDATORY 0x00000002 +#define LOG_OPT_QUOTE 0x00000004 +#define LOG_OPT_REQ_CAP 0x00000008 +#define LOG_OPT_RES_CAP 0x00000010 +#define LOG_OPT_HTTP 0x00000020 +#define LOG_OPT_ESC 0x00000040 + + +/* Fields that need to be extracted from the incoming connection or request for + * logging or for sending specific header information. They're set in px->to_log + * and appear as flags in session->logs.logwait, which are removed once the + * required information has been collected. + */ +#define LW_INIT 1 /* anything */ +#define LW_CLIP 2 /* CLient IP */ +#define LW_SVIP 4 /* SerVer IP */ +#define LW_SVID 8 /* server ID */ +#define LW_REQ 16 /* http REQuest */ +#define LW_RESP 32 /* http RESPonse */ +#define LW_BYTES 256 /* bytes read from server */ +#define LW_COOKIE 512 /* captured cookie */ +#define LW_REQHDR 1024 /* request header(s) */ +#define LW_RSPHDR 2048 /* response header(s) */ +#define LW_BCKIP 4096 /* backend IP */ +#define LW_FRTIP 8192 /* frontend IP */ +#define LW_XPRT 16384 /* transport layer information (eg: SSL) */ -/* The array containing the names of the log levels. */ -extern const char *log_levels[]; /* enum for log format */ enum { @@ -60,7 +84,7 @@ enum log_tgt { LOG_TARGET_BUFFER, // ring buffer }; -/* lists of fields that can be logged */ +/* lists of fields that can be logged, for logformat_node->type */ enum { LOG_FMT_TEXT = 0, /* raw text */ @@ -156,34 +180,6 @@ struct logformat_node { void *expr; // for use with LOG_FMT_EXPR }; -#define LOG_OPT_HEXA 0x00000001 -#define LOG_OPT_MANDATORY 0x00000002 -#define LOG_OPT_QUOTE 0x00000004 -#define LOG_OPT_REQ_CAP 0x00000008 -#define LOG_OPT_RES_CAP 0x00000010 -#define LOG_OPT_HTTP 0x00000020 -#define LOG_OPT_ESC 0x00000040 - - -/* Fields that need to be extracted from the incoming connection or request for - * logging or for sending specific header information. They're set in px->to_log - * and appear as flags in session->logs.logwait, which are removed once the - * required information has been collected. - */ -#define LW_INIT 1 /* anything */ -#define LW_CLIP 2 /* CLient IP */ -#define LW_SVIP 4 /* SerVer IP */ -#define LW_SVID 8 /* server ID */ -#define LW_REQ 16 /* http REQuest */ -#define LW_RESP 32 /* http RESPonse */ -#define LW_BYTES 256 /* bytes read from server */ -#define LW_COOKIE 512 /* captured cookie */ -#define LW_REQHDR 1024 /* request header(s) */ -#define LW_RSPHDR 2048 /* response header(s) */ -#define LW_BCKIP 4096 /* backend IP */ -#define LW_FRTIP 8192 /* frontend IP */ -#define LW_XPRT 16384 /* transport layer information (eg: SSL) */ - /* Range of indexes for log sampling. */ struct smp_log_range { unsigned int low; /* Low limit of the indexes of this range. */ @@ -223,7 +219,7 @@ struct logsrv { __decl_thread(HA_SPINLOCK_T lock); }; -#endif /* _TYPES_LOG_H */ +#endif /* _HAPROXY_LOG_T_H */ /* * Local variables: diff --git a/include/proto/log.h b/include/haproxy/log.h similarity index 81% rename from include/proto/log.h rename to include/haproxy/log.h index 48802dc10..caddd95b8 100644 --- a/include/proto/log.h +++ b/include/haproxy/log.h @@ -1,44 +1,40 @@ /* - include/proto/log.h - This file contains definitions of log-related functions, structures, - and macros. + * include/haproxy/log.h + * This file contains definitions of log-related 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 + */ - 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. +#ifndef _HAPROXY_LOG_H +#define _HAPROXY_LOG_H - 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 _PROTO_LOG_H -#define _PROTO_LOG_H - -#include #include #include -#include +#include +#include #include - -#include -#include -#include - #include +#include extern struct pool_head *pool_head_requri; extern struct pool_head *pool_head_uniqueid; +extern const char *log_levels[]; extern char *log_format; extern char default_tcp_log_format[]; extern char default_http_log_format[]; @@ -54,32 +50,13 @@ extern THREAD_LOCAL char *logline; extern THREAD_LOCAL char *logline_rfc5424; -/* - * Test if index numbered from 0 is in range with low and high - * limits of indexes numbered from 1. - */ -static inline int in_smp_log_range(struct smp_log_range *rg, unsigned int idx) -{ - if (idx + 1 <= rg->high && idx + 1 >= rg->low) - return 1; - return 0; -} - /* Initialize/Deinitialize log buffers used for syslog messages */ int init_log_buffers(); void deinit_log_buffers(); -/* - * Builds a log line. - */ +/* build a log line for the session and an optional stream */ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t maxsize, struct list *list_format); -static inline int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list_format) -{ - return sess_build_logline(strm_sess(s), s, dst, maxsize, list_format); -} - - /* * send a log for the stream when we have enough info about it. * Will not log if the frontend has no log defined. @@ -191,7 +168,26 @@ char *update_log_hdr(const time_t time); char * get_format_pid_sep1(int format, size_t *len); char * get_format_pid_sep2(int format, size_t *len); -#endif /* _PROTO_LOG_H */ +/* + * Test if index numbered from 0 is in range with low and high + * limits of indexes numbered from 1. + */ +static inline int in_smp_log_range(struct smp_log_range *rg, unsigned int idx) +{ + if (idx + 1 <= rg->high && idx + 1 >= rg->low) + return 1; + return 0; +} + +/* + * Builds a log line for the stream (must be valid). + */ +static inline int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list_format) +{ + return sess_build_logline(strm_sess(s), s, dst, maxsize, list_format); +} + +#endif /* _HAPROXY_LOG_H */ /* * Local variables: diff --git a/include/haproxy/trace.h b/include/haproxy/trace.h index 0367aa73e..ae5a3c189 100644 --- a/include/haproxy/trace.h +++ b/include/haproxy/trace.h @@ -29,7 +29,6 @@ #include #include #include -#include /* Make a string from the location of the trace producer as "file:line" */ #define TRC_LOC _TRC_LOC(__FILE__, __LINE__) diff --git a/include/proto/server.h b/include/proto/server.h index 4d78c1d27..34314236f 100644 --- a/include/proto/server.h +++ b/include/proto/server.h @@ -27,13 +27,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include diff --git a/include/types/proxy.h b/include/types/proxy.h index b86df8d92..6bcad167c 100644 --- a/include/types/proxy.h +++ b/include/types/proxy.h @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/include/types/spoe.h b/include/types/spoe.h index 1538a729a..1f0a84aaf 100644 --- a/include/types/spoe.h +++ b/include/types/spoe.h @@ -30,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/src/51d.c b/src/51d.c index 37124ea37..12f40ea09 100644 --- a/src/51d.c +++ b/src/51d.c @@ -8,10 +8,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/src/acl.c b/src/acl.c index 275087de7..f3332ac27 100644 --- a/src/acl.c +++ b/src/acl.c @@ -18,13 +18,13 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/src/action.c b/src/action.c index fa3b4f777..999790356 100644 --- a/src/action.c +++ b/src/action.c @@ -15,10 +15,10 @@ #include #include #include +#include #include #include -#include #include #include diff --git a/src/auth.c b/src/auth.c index faac16d4e..646c0109e 100644 --- a/src/auth.c +++ b/src/auth.c @@ -29,11 +29,10 @@ #include #include #include +#include #include #include -#include - struct userlist *userlist = NULL; /* list of all existing userlists */ #ifdef USE_LIBCRYPT diff --git a/src/backend.c b/src/backend.c index f79ac18e5..423163f26 100644 --- a/src/backend.c +++ b/src/backend.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -48,7 +49,6 @@ #include #include -#include #include #include #include diff --git a/src/cache.c b/src/cache.c index 17d015afa..0858a8de8 100644 --- a/src/cache.c +++ b/src/cache.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,6 @@ #include #include -#include #include diff --git a/src/cfgparse.c b/src/cfgparse.c index 8bd60b7cb..a15028b2e 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -71,7 +72,6 @@ #include #include -#include #include #include #include diff --git a/src/check.c b/src/check.c index 7381a324f..6b4f9faec 100644 --- a/src/check.c +++ b/src/check.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -58,14 +59,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include diff --git a/src/cli.c b/src/cli.c index 9e6b56ac3..e5413e9f0 100644 --- a/src/cli.c +++ b/src/cli.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -57,7 +58,6 @@ #include #include #include -#include #include #include #include diff --git a/src/da.c b/src/da.c index 1d62ade4a..6090851ab 100644 --- a/src/da.c +++ b/src/da.c @@ -8,9 +8,9 @@ #include #include #include +#include #include #include -#include #include #include diff --git a/src/debug.c b/src/debug.c index 4f7e6cea7..6829eb286 100644 --- a/src/debug.c +++ b/src/debug.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/src/dns.c b/src/dns.c index 7658f6f84..bcbc435ae 100644 --- a/src/dns.c +++ b/src/dns.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -41,7 +42,6 @@ #include #include -#include #include #include #include diff --git a/src/ev_evports.c b/src/ev_evports.c index 3d6024712..81cbe5138 100644 --- a/src/ev_evports.c +++ b/src/ev_evports.c @@ -28,7 +28,6 @@ #include #include -#include /* * Private data: diff --git a/src/fcgi-app.c b/src/fcgi-app.c index 629c67792..d7183c5fd 100644 --- a/src/fcgi-app.c +++ b/src/fcgi-app.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,6 @@ #include -#include #include #include diff --git a/src/fd.c b/src/fd.c index 82f619625..d3940bb12 100644 --- a/src/fd.c +++ b/src/fd.c @@ -92,7 +92,6 @@ #include #include -#include #include struct fdtab *fdtab = NULL; /* array of all the file descriptors */ diff --git a/src/flt_spoe.c b/src/flt_spoe.c index f532d2d85..f5094c02f 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -37,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/src/flt_trace.c b/src/flt_trace.c index 2f55b73d1..01278bb0b 100644 --- a/src/flt_trace.c +++ b/src/flt_trace.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -25,7 +26,6 @@ #include #include -#include #include const char *trace_flt_id = "trace filter"; diff --git a/src/frontend.c b/src/frontend.c index 09adbea15..8252c81be 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -37,7 +38,6 @@ #include #include -#include #include #include #include diff --git a/src/haproxy.c b/src/haproxy.c index 6488df9b3..9e2f94a2c 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -97,6 +97,7 @@ #include #include #include +#include #include #include #include @@ -123,7 +124,6 @@ #include #include #include -#include #include #include #include diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c index c14c885ff..12bca02c3 100644 --- a/src/hlua_fcn.c +++ b/src/hlua_fcn.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/src/http_act.c b/src/http_act.c index 06ab3c271..a688acbaa 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -38,7 +38,6 @@ #include #include -#include /* Release memory allocated by most of HTTP actions. Concretly, it releases * . diff --git a/src/http_ana.c b/src/http_ana.c index 8e8dd2fa0..373e399a7 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include -#include #include #include #include diff --git a/src/http_fetch.c b/src/http_fetch.c index 65fbe877e..812ede5c7 100644 --- a/src/http_fetch.c +++ b/src/http_fetch.c @@ -37,7 +37,6 @@ #include #include -#include #include diff --git a/src/listener.c b/src/listener.c index ab0a4a726..177964296 100644 --- a/src/listener.c +++ b/src/listener.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include -#include #include #include #include diff --git a/src/log.c b/src/log.c index 4f095cafd..4027db28b 100644 --- a/src/log.c +++ b/src/log.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -36,10 +37,8 @@ #include #include -#include #include -#include #include #include #include diff --git a/src/map.c b/src/map.c index 7beefde74..243676d2e 100644 --- a/src/map.c +++ b/src/map.c @@ -23,7 +23,6 @@ #include #include -#include #include /* Parse an IPv4 or IPv6 address and store it into the sample. diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index 2bb586262..e13ce55b5 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -29,7 +30,6 @@ #include -#include #include #include diff --git a/src/mux_h1.c b/src/mux_h1.c index ada8bb18b..75a640847 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/mworker-prog.c b/src/mworker-prog.c index 0a448beab..800624f94 100644 --- a/src/mworker-prog.c +++ b/src/mworker-prog.c @@ -23,9 +23,9 @@ #include #include #include +#include #include -#include static int use_program = 0; /* do we use the program section ? */ diff --git a/src/mworker.c b/src/mworker.c index bccffaa58..d891f2fda 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include -#include #include #include diff --git a/src/namespace.c b/src/namespace.c index dfda7a5e3..8b7190ca0 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -14,8 +14,8 @@ #include #include #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 0ec22c10d..bbd7faa26 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -16,12 +16,12 @@ #include #include +#include #include #include #include #include -#include #include #include diff --git a/src/peers.c b/src/peers.c index c5d809591..633f9aeb7 100644 --- a/src/peers.c +++ b/src/peers.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,6 @@ #include #include -#include #include #include #include diff --git a/src/pool.c b/src/pool.c index 41d9c449a..78809bb7a 100644 --- a/src/pool.c +++ b/src/pool.c @@ -21,13 +21,13 @@ #include #include #include +#include #include #include #include #include -#include #ifdef CONFIG_HAP_LOCAL_POOLS /* These are the most common pools, expected to be initialized first. These diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c index cb1853681..c72c6ac20 100644 --- a/src/proto_sockpair.c +++ b/src/proto_sockpair.c @@ -32,13 +32,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include static void sockpair_add_listener(struct listener *listener, int port); diff --git a/src/proto_tcp.c b/src/proto_tcp.c index b25779ccd..63624f600 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,6 @@ #include #include -#include #include #include #include diff --git a/src/proto_uxst.c b/src/proto_uxst.c index 33c79e9a7..ea516ba19 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -32,12 +32,12 @@ #include #include #include +#include #include #include #include #include -#include #include static int uxst_bind_listener(struct listener *listener, char *errmsg, int errlen); diff --git a/src/proxy.c b/src/proxy.c index 78d91e6e2..6a0a158a4 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -41,7 +42,6 @@ #include #include -#include #include #include #include diff --git a/src/raw_sock.c b/src/raw_sock.c index 3453aac1b..099f50341 100644 --- a/src/raw_sock.c +++ b/src/raw_sock.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -33,7 +34,6 @@ #include #include -#include #include diff --git a/src/regex.c b/src/regex.c index b2f325d7a..3510f72c8 100644 --- a/src/regex.c +++ b/src/regex.c @@ -15,9 +15,9 @@ #include #include +#include #include #include -#include /* regex trash buffer used by various regex tests */ THREAD_LOCAL regmatch_t pmatch[MAX_MATCH]; /* rm_so, rm_eo for regular expressions */ diff --git a/src/sample.c b/src/sample.c index 23f7bf267..99b6fd548 100644 --- a/src/sample.c +++ b/src/sample.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include -#include #include #include #include diff --git a/src/session.c b/src/session.c index 58e55ee6d..4169870f9 100644 --- a/src/session.c +++ b/src/session.c @@ -15,12 +15,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/src/signal.c b/src/signal.c index 6d0154815..1f8ec834c 100644 --- a/src/signal.c +++ b/src/signal.c @@ -13,9 +13,9 @@ #include #include +#include #include #include -#include /* Principle : we keep an in-order list of the first occurrence of all received * signals. All occurrences of a same signal are grouped though. The signal diff --git a/src/sink.c b/src/sink.c index 93beccf08..b6e1b857e 100644 --- a/src/sink.c +++ b/src/sink.c @@ -23,8 +23,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c index 43fe01d3b..d2fd4e181 100644 --- a/src/ssl_ckch.c +++ b/src/ssl_ckch.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c index 3890ca833..8e6a2e42d 100644 --- a/src/ssl_crtlist.c +++ b/src/ssl_crtlist.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include diff --git a/src/ssl_sock.c b/src/ssl_sock.c index a586b6255..1b1b0e47d 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -77,7 +78,6 @@ #include #include #include -#include #include #include diff --git a/src/stats.c b/src/stats.c index 573721566..40ea9c8be 100644 --- a/src/stats.c +++ b/src/stats.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -58,7 +59,6 @@ #include #include #include -#include #include #include #include diff --git a/src/stick_table.c b/src/stick_table.c index 3a8d62f44..fdf1b585a 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include -#include #include #include #include diff --git a/src/stream.c b/src/stream.c index fc2798d09..eab3356ac 100644 --- a/src/stream.c +++ b/src/stream.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,6 @@ #include #include #include -#include #include #include #include diff --git a/src/tcp_rules.c b/src/tcp_rules.c index e7abdd76f..a02e25f04 100644 --- a/src/tcp_rules.c +++ b/src/tcp_rules.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -27,7 +28,6 @@ #include -#include #include #include #include diff --git a/src/trace.c b/src/trace.c index bb9db085a..997a994fd 100644 --- a/src/trace.c +++ b/src/trace.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/uri_auth.c b/src/uri_auth.c index 2005bc812..248431cd7 100644 --- a/src/uri_auth.c +++ b/src/uri_auth.c @@ -15,10 +15,10 @@ #include #include +#include #include #include -#include /* * Initializes a basic uri_auth structure header and returns a pointer to it. diff --git a/src/wdt.c b/src/wdt.c index 3485c8f5a..c17d67c3c 100644 --- a/src/wdt.c +++ b/src/wdt.c @@ -15,9 +15,9 @@ #include #include #include +#include #include #include -#include /* diff --git a/src/wurfl.c b/src/wurfl.c index f7992e53c..57e794e16 100644 --- a/src/wurfl.c +++ b/src/wurfl.c @@ -10,8 +10,8 @@ #include #include #include +#include #include -#include #include #include #include