diff --git a/contrib/debug/flags.c b/contrib/debug/flags.c index f38378f7d..2287ee363 100644 --- a/contrib/debug/flags.c +++ b/contrib/debug/flags.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include // 1 bit per flag, no hole permitted here #define SHOW_AS_ANA 0x00000001 diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c index ed27bc49e..50dc14f81 100644 --- a/contrib/prometheus-exporter/service-prometheus.c +++ b/contrib/prometheus-exporter/service-prometheus.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include /* Prometheus exporter applet states (appctx->st0) */ enum { diff --git a/include/haproxy/dns-t.h b/include/haproxy/dns-t.h index 54c58ee6c..832016b0b 100644 --- a/include/haproxy/dns-t.h +++ b/include/haproxy/dns-t.h @@ -30,7 +30,7 @@ #include #include -#include +#include extern struct pool_head *dns_requester_pool; diff --git a/include/types/task.h b/include/haproxy/task-t.h similarity index 97% rename from include/types/task.h rename to include/haproxy/task-t.h index 6515d464a..11f0cb664 100644 --- a/include/types/task.h +++ b/include/haproxy/task-t.h @@ -1,5 +1,5 @@ /* - * include/types/task.h + * include/haproxy/task-t.h * Macros, variables and structures for task management. * * Copyright (C) 2000-2010 Willy Tarreau - w@1wt.eu @@ -19,16 +19,18 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _TYPES_TASK_H -#define _TYPES_TASK_H +#ifndef _HAPROXY_TASK_T_H +#define _HAPROXY_TASK_T_H #include -#include -#include #include #include +#include +#include +#include + /* values for task->state */ #define TASK_SLEEPING 0x0000 /* task sleeping */ #define TASK_RUNNING 0x0001 /* the task is currently running */ @@ -110,8 +112,6 @@ struct tasklet { int tid; /* TID of the tasklet owner, <0 if local */ }; -#define TASK_IS_TASKLET(t) ((t)->nice == -32768) - /* * The task callback (->process) is responsible for updating ->expire. It must * return a pointer to the task itself, except if the task has been deleted, in @@ -136,7 +136,7 @@ struct work_list { void *arg; }; -#endif /* _TYPES_TASK_H */ +#endif /* _HAPROXY_TASK_T_H */ /* * Local variables: diff --git a/include/proto/task.h b/include/haproxy/task.h similarity index 98% rename from include/proto/task.h rename to include/haproxy/task.h index 85ec75a65..3ba7fb9d8 100644 --- a/include/proto/task.h +++ b/include/haproxy/task.h @@ -1,8 +1,8 @@ /* - * include/proto/task.h + * include/haproxy/task.h * Functions for task management. * - * Copyright (C) 2000-2010 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,26 +19,25 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _PROTO_TASK_H -#define _PROTO_TASK_H +#ifndef _HAPROXY_TASK_H +#define _HAPROXY_TASK_H #include -#include -#include -#include -#include -#include -#include -#include - #include #include -#include - +#include #include +#include +#include +#include +#include +#include +#include +#include + /* Principle of the wait queue. * @@ -83,6 +82,10 @@ /* The farthest we can look back in a timer tree */ #define TIMER_LOOK_BACK (1U << 31) +/* tasklets are recognized with nice==-32768 */ +#define TASK_IS_TASKLET(t) ((t)->nice == -32768) + + /* a few exported variables */ extern unsigned int nb_tasks; /* total number of tasks */ extern volatile unsigned long global_tasks_mask; /* Mask of threads with tasks in the global runqueue */ @@ -94,6 +97,7 @@ extern struct pool_head *pool_head_task; extern struct pool_head *pool_head_tasklet; extern struct pool_head *pool_head_notification; extern THREAD_LOCAL struct task_per_thread *sched; /* current's thread scheduler context */ + #ifdef USE_THREAD extern struct eb_root timers; /* sorted timers tree, global */ extern struct eb_root rqueue; /* tree constituting the run queue */ @@ -105,8 +109,42 @@ extern struct task_per_thread task_per_thread[MAX_THREADS]; __decl_thread(extern HA_SPINLOCK_T rq_lock); /* spin lock related to run queue */ __decl_thread(extern HA_RWLOCK_T wq_lock); /* RW lock related to the wait queue */ -static inline struct task *task_unlink_wq(struct task *t); -static inline void task_queue(struct task *task); +void __task_wakeup(struct task *t, struct eb_root *); +void __task_queue(struct task *task, struct eb_root *wq); + +struct work_list *work_list_create(int nbthread, + struct task *(*fct)(struct task *, void *, unsigned short), + void *arg); +void work_list_destroy(struct work_list *work, int nbthread); +int run_tasks_from_list(struct list *list, int max); + +/* + * This does 3 things : + * - wake up all expired tasks + * - call all runnable tasks + * - return the date of next event in or eternity. + */ + +void process_runnable_tasks(); + +/* + * Extract all expired timers from the timer queue, and wakes up all + * associated tasks. + */ +void wake_expired_tasks(); + +/* Checks the next timer for the current thread by looking into its own timer + * list and the global one. It may return TICK_ETERNITY if no timer is present. + * Note that the next timer might very well be slightly in the past. + */ +int next_timer_expiry(); + +/* + * Delete every tasks before running the master polling loop + */ +void mworker_cleantasks(); + + /* return 0 if task is in run queue, otherwise non-zero */ static inline int task_in_rq(struct task *t) @@ -123,11 +161,21 @@ static inline int task_in_wq(struct task *t) return t->wq.node.leaf_p != NULL; } +/* returns true if the current thread has some work to do */ +static inline int thread_has_tasks(void) +{ + return (!!(global_tasks_mask & tid_bit) | + (sched->rqueue_size > 0) | + !LIST_ISEMPTY(&sched->tasklets[TL_URGENT]) | + !LIST_ISEMPTY(&sched->tasklets[TL_NORMAL]) | + !LIST_ISEMPTY(&sched->tasklets[TL_BULK]) | + !MT_LIST_ISEMPTY(&sched->shared_tasklet_list)); +} + /* puts the task in run queue with reason flags , and returns */ /* This will put the task in the local runqueue if the task is only runnable * by the current thread, in the global runqueue otherwies. */ -void __task_wakeup(struct task *t, struct eb_root *); static inline void task_wakeup(struct task *t, unsigned int f) { unsigned short state; @@ -152,24 +200,6 @@ static inline void task_wakeup(struct task *t, unsigned int f) } } -/* change the thread affinity of a task to . - * This may only be done from within the running task itself or during its - * initialization. It will unqueue and requeue the task from the wait queue - * if it was in it. This is safe against a concurrent task_queue() call because - * task_queue() itself will unlink again if needed after taking into account - * the new thread_mask. - */ -static inline void task_set_affinity(struct task *t, unsigned long thread_mask) -{ - if (unlikely(task_in_wq(t))) { - task_unlink_wq(t); - t->thread_mask = thread_mask; - task_queue(t); - } - else - t->thread_mask = thread_mask; -} - /* * Unlink the task from the wait queue, and possibly update the last_timer * pointer. A pointer to the task itself is returned. The task *must* already @@ -201,6 +231,59 @@ static inline struct task *task_unlink_wq(struct task *t) return t; } +/* Place into the wait queue, where it may already be. If the expiration + * timer is infinite, do nothing and rely on wake_expired_task to clean up. + * If the task uses a shared wait queue, it's queued into the global wait queue, + * protected by the global wq_lock, otherwise by it necessarily belongs to the + * current thread'sand is queued without locking. + */ +static inline void task_queue(struct task *task) +{ + /* If we already have a place in the wait queue no later than the + * timeout we're trying to set, we'll stay there, because it is very + * unlikely that we will reach the timeout anyway. If the timeout + * has been disabled, it's useless to leave the queue as well. We'll + * rely on wake_expired_tasks() to catch the node and move it to the + * proper place should it ever happen. Finally we only add the task + * to the queue if it was not there or if it was further than what + * we want. + */ + if (!tick_isset(task->expire)) + return; + +#ifdef USE_THREAD + if (task->state & TASK_SHARED_WQ) { + HA_RWLOCK_WRLOCK(TASK_WQ_LOCK, &wq_lock); + if (!task_in_wq(task) || tick_is_lt(task->expire, task->wq.key)) + __task_queue(task, &timers); + HA_RWLOCK_WRUNLOCK(TASK_WQ_LOCK, &wq_lock); + } else +#endif + { + BUG_ON((task->thread_mask & tid_bit) == 0); // should have TASK_SHARED_WQ + if (!task_in_wq(task) || tick_is_lt(task->expire, task->wq.key)) + __task_queue(task, &sched->timers); + } +} + +/* change the thread affinity of a task to . + * This may only be done from within the running task itself or during its + * initialization. It will unqueue and requeue the task from the wait queue + * if it was in it. This is safe against a concurrent task_queue() call because + * task_queue() itself will unlink again if needed after taking into account + * the new thread_mask. + */ +static inline void task_set_affinity(struct task *t, unsigned long thread_mask) +{ + if (unlikely(task_in_wq(t))) { + task_unlink_wq(t); + t->thread_mask = thread_mask; + task_queue(t); + } + else + t->thread_mask = thread_mask; +} + /* * Unlink the task from the run queue. The tasks_run_queue size and number of * niced tasks are updated too. A pointer to the task itself is returned. The @@ -419,43 +502,6 @@ static inline void tasklet_set_tid(struct tasklet *tl, int tid) tl->tid = tid; } -void __task_queue(struct task *task, struct eb_root *wq); - -/* Place into the wait queue, where it may already be. If the expiration - * timer is infinite, do nothing and rely on wake_expired_task to clean up. - * If the task uses a shared wait queue, it's queued into the global wait queue, - * protected by the global wq_lock, otherwise by it necessarily belongs to the - * current thread'sand is queued without locking. - */ -static inline void task_queue(struct task *task) -{ - /* If we already have a place in the wait queue no later than the - * timeout we're trying to set, we'll stay there, because it is very - * unlikely that we will reach the timeout anyway. If the timeout - * has been disabled, it's useless to leave the queue as well. We'll - * rely on wake_expired_tasks() to catch the node and move it to the - * proper place should it ever happen. Finally we only add the task - * to the queue if it was not there or if it was further than what - * we want. - */ - if (!tick_isset(task->expire)) - return; - -#ifdef USE_THREAD - if (task->state & TASK_SHARED_WQ) { - HA_RWLOCK_WRLOCK(TASK_WQ_LOCK, &wq_lock); - if (!task_in_wq(task) || tick_is_lt(task->expire, task->wq.key)) - __task_queue(task, &timers); - HA_RWLOCK_WRUNLOCK(TASK_WQ_LOCK, &wq_lock); - } else -#endif - { - BUG_ON((task->thread_mask & tid_bit) == 0); // should have TASK_SHARED_WQ - if (!task_in_wq(task) || tick_is_lt(task->expire, task->wq.key)) - __task_queue(task, &sched->timers); - } -} - /* Ensure will be woken up at most at . If the task is already in * the run queue (but not running), nothing is done. It may be used that way * with a delay : task_schedule(task, tick_add(now_ms, delay)); @@ -586,16 +632,6 @@ static inline int notification_registered(struct list *wake) return !LIST_ISEMPTY(wake); } -static inline int thread_has_tasks(void) -{ - return (!!(global_tasks_mask & tid_bit) | - (sched->rqueue_size > 0) | - !LIST_ISEMPTY(&sched->tasklets[TL_URGENT]) | - !LIST_ISEMPTY(&sched->tasklets[TL_NORMAL]) | - !LIST_ISEMPTY(&sched->tasklets[TL_BULK]) | - !MT_LIST_ISEMPTY(&sched->shared_tasklet_list)); -} - /* adds list item to work list and wake up the associated task */ static inline void work_list_add(struct work_list *work, struct mt_list *item) { @@ -603,40 +639,7 @@ static inline void work_list_add(struct work_list *work, struct mt_list *item) task_wakeup(work->task, TASK_WOKEN_OTHER); } -struct work_list *work_list_create(int nbthread, - struct task *(*fct)(struct task *, void *, unsigned short), - void *arg); - -void work_list_destroy(struct work_list *work, int nbthread); -int run_tasks_from_list(struct list *list, int max); - -/* - * This does 3 things : - * - wake up all expired tasks - * - call all runnable tasks - * - return the date of next event in or eternity. - */ - -void process_runnable_tasks(); - -/* - * Extract all expired timers from the timer queue, and wakes up all - * associated tasks. - */ -void wake_expired_tasks(); - -/* Checks the next timer for the current thread by looking into its own timer - * list and the global one. It may return TICK_ETERNITY if no timer is present. - * Note that the next timer might very well be slightly in the past. - */ -int next_timer_expiry(); - -/* - * Delete every tasks before running the master polling loop - */ -void mworker_cleantasks(); - -#endif /* _PROTO_TASK_H */ +#endif /* _HAPROXY_TASK_H */ /* * Local variables: diff --git a/include/proto/applet.h b/include/proto/applet.h index 80744ba13..48437f5f5 100644 --- a/include/proto/applet.h +++ b/include/proto/applet.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include extern unsigned int nb_applets; extern struct pool_head *pool_head_appctx; diff --git a/include/proto/channel.h b/include/proto/channel.h index 354758188..96bf2125a 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -40,7 +40,7 @@ #include #include -#include +#include /* perform minimal intializations, report 0 in case of error, 1 if OK. */ int init_channel(); diff --git a/include/proto/connection.h b/include/proto/connection.h index 753aea459..baa801f9c 100644 --- a/include/proto/connection.h +++ b/include/proto/connection.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include extern struct pool_head *pool_head_connection; extern struct pool_head *pool_head_connstream; diff --git a/include/proto/proto_tcp.h b/include/proto/proto_tcp.h index 29e6c1c2d..ad428ee42 100644 --- a/include/proto/proto_tcp.h +++ b/include/proto/proto_tcp.h @@ -23,7 +23,6 @@ #define _PROTO_PROTO_TCP_H #include -#include #include int tcp_bind_socket(int fd, int flags, struct sockaddr_storage *local, struct sockaddr_storage *remote); diff --git a/include/proto/queue.h b/include/proto/queue.h index d4da40c73..4397d601f 100644 --- a/include/proto/queue.h +++ b/include/proto/queue.h @@ -29,7 +29,6 @@ #include #include #include -#include #include diff --git a/include/proto/signal.h b/include/proto/signal.h index aaa23f633..04dc449ce 100644 --- a/include/proto/signal.h +++ b/include/proto/signal.h @@ -15,7 +15,7 @@ #include #include -#include +#include extern int signal_queue_len; extern struct signal_descriptor signal_state[]; diff --git a/include/proto/stream.h b/include/proto/stream.h index 1c0fd4547..9be8d4647 100644 --- a/include/proto/stream.h +++ b/include/proto/stream.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include extern struct trace_source trace_strm; diff --git a/include/proto/tcp_rules.h b/include/proto/tcp_rules.h index 2059c0927..5f12c264d 100644 --- a/include/proto/tcp_rules.h +++ b/include/proto/tcp_rules.h @@ -24,7 +24,6 @@ #include #include -#include #include int tcp_inspect_request(struct stream *s, struct channel *req, int an_bit); diff --git a/include/types/checks.h b/include/types/checks.h index 371ed431c..c7f08b276 100644 --- a/include/types/checks.h +++ b/include/types/checks.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include /* enum used by check->result. Must remain in this order, as some code uses * result >= CHK_RES_PASSED to declare success. diff --git a/include/types/server.h b/include/types/server.h index a9d333e17..a2f1fe368 100644 --- a/include/types/server.h +++ b/include/types/server.h @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include diff --git a/include/types/session.h b/include/types/session.h index 3e49b461b..559e78646 100644 --- a/include/types/session.h +++ b/include/types/session.h @@ -34,7 +34,7 @@ #include #include -#include +#include struct sess_srv_list { void *target; diff --git a/include/types/spoe.h b/include/types/spoe.h index fdaba93ea..c7ed45d5a 100644 --- a/include/types/spoe.h +++ b/include/types/spoe.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include /* Type of list of messages */ #define SPOE_MSGS_BY_EVENT 0x01 diff --git a/include/types/stream.h b/include/types/stream.h index 88708428c..e2e01db05 100644 --- a/include/types/stream.h +++ b/include/types/stream.h @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include /* Various Stream Flags, bits values 0x01 to 0x100 (shift 0) */ diff --git a/src/action.c b/src/action.c index a7f1b7e3b..4889a4b16 100644 --- a/src/action.c +++ b/src/action.c @@ -15,12 +15,12 @@ #include #include #include +#include #include #include #include #include -#include /* Find and check the target table used by an action track-sc*. This diff --git a/src/applet.c b/src/applet.c index 88be4474e..510faad77 100644 --- a/src/applet.c +++ b/src/applet.c @@ -15,11 +15,11 @@ #include #include +#include #include #include #include #include -#include unsigned int nb_applets = 0; diff --git a/src/backend.c b/src/backend.c index 18ac58306..02f8e8671 100644 --- a/src/backend.c +++ b/src/backend.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -55,7 +56,6 @@ #include #include #include -#include #define TRACE_SOURCE &trace_strm diff --git a/src/cfgparse.c b/src/cfgparse.c index 8ea64a199..7fc6fd5cd 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -79,7 +80,6 @@ #include #include #include -#include #include #include diff --git a/src/checks.c b/src/checks.c index af34ebebb..39399db31 100644 --- a/src/checks.c +++ b/src/checks.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -64,7 +65,6 @@ #include #include #include -#include #include #include #include diff --git a/src/cli.c b/src/cli.c index b9481c1f1..4208ceabf 100644 --- a/src/cli.c +++ b/src/cli.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -63,7 +64,6 @@ #include #include #include -#include #define PAYLOAD_PATTERN "<<" diff --git a/src/debug.c b/src/debug.c index c17965246..30a41161b 100644 --- a/src/debug.c +++ b/src/debug.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include /* mask of threads still having to dump, used to respect ordering. Only used * when USE_THREAD_DUMP is set. diff --git a/src/dns.c b/src/dns.c index 4fec311d2..dca257561 100644 --- a/src/dns.c +++ b/src/dns.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +44,6 @@ #include #include #include -#include #include #include #include diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 64650ae52..6c0ef4e18 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include #include #if defined(DEBUG_SPOE) || defined(DEBUG_FULL) diff --git a/src/frontend.c b/src/frontend.c index 44ac1514f..4066fe9b5 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -41,7 +42,6 @@ #include #include #include -#include /* Finish a stream accept() for a proxy (TCP or HTTP). It returns a negative * value in case of a critical failure which must cause the listener to be diff --git a/src/haproxy.c b/src/haproxy.c index 377bb2e59..e85b9556f 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -104,6 +104,7 @@ #include #include #include +#include #include #include @@ -132,7 +133,6 @@ #include #include #include -#include #include /* array of init calls for older platforms */ diff --git a/src/hlua.c b/src/hlua.c index fda7212bf..4ef94d179 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -58,7 +59,6 @@ #include #include #include -#include #include /* Lua uses longjmp to perform yield or throwing errors. This diff --git a/src/listener.c b/src/listener.c index 417a902b4..4d1d2de11 100644 --- a/src/listener.c +++ b/src/listener.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include /* List head of all known bind keywords */ static struct bind_kw_list bind_keywords = { diff --git a/src/mux_pt.c b/src/mux_pt.c index 43b0da4aa..d405e9550 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -12,9 +12,9 @@ #include #include +#include #include #include -#include struct mux_pt_ctx { struct conn_stream *cs; diff --git a/src/peers.c b/src/peers.c index 372434634..e1a2525a0 100644 --- a/src/peers.c +++ b/src/peers.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,6 @@ #include #include #include -#include /*******************************/ diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c index a0453c1bc..cca9d72ec 100644 --- a/src/proto_sockpair.c +++ b/src/proto_sockpair.c @@ -40,7 +40,6 @@ #include #include #include -#include static void sockpair_add_listener(struct listener *listener, int port); static int sockpair_bind_listener(struct listener *listener, char *errmsg, int errlen); diff --git a/src/proto_tcp.c b/src/proto_tcp.c index e6eae9960..3f734a681 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -55,7 +55,6 @@ #include #include #include -#include #include static int tcp_bind_listeners(struct protocol *proto, char *errmsg, int errlen); diff --git a/src/proto_uxst.c b/src/proto_uxst.c index 69253732b..c826546d6 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -39,7 +39,6 @@ #include #include #include -#include static int uxst_bind_listener(struct listener *listener, char *errmsg, int errlen); static int uxst_bind_listeners(struct protocol *proto, char *errmsg, int errlen); diff --git a/src/proxy.c b/src/proxy.c index 5d422170f..71ad054dc 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,6 @@ #include #include #include -#include int listeners; /* # of proxy listeners, set by cfgparse */ diff --git a/src/queue.c b/src/queue.c index bbf11e22d..5c8f790af 100644 --- a/src/queue.c +++ b/src/queue.c @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include @@ -82,7 +83,6 @@ #include #include #include -#include #include diff --git a/src/raw_sock.c b/src/raw_sock.c index b5538d64e..396a07cc0 100644 --- a/src/raw_sock.c +++ b/src/raw_sock.c @@ -35,7 +35,6 @@ #include #include #include -#include #if defined(USE_LINUX_SPLICE) diff --git a/src/server.c b/src/server.c index ddc61873c..694d5ae91 100644 --- a/src/server.c +++ b/src/server.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include #include #include diff --git a/src/signal.c b/src/signal.c index d989ef66b..98ed9921d 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/ssl_sock.c b/src/ssl_sock.c index c1f239a7a..0d6267a8f 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -85,7 +86,6 @@ #include #include #include -#include /* ***** READ THIS before adding code here! ***** * diff --git a/src/stats.c b/src/stats.c index 555b56140..281638cfe 100644 --- a/src/stats.c +++ b/src/stats.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -65,7 +66,6 @@ #include #include #include -#include /* status codes available for the stats admin page (strictly 4 chars length) */ const char *stat_status_codes[STAT_STATUS_SIZE] = { diff --git a/src/stick_table.c b/src/stick_table.c index 638d30c57..9020b372a 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/src/stream.c b/src/stream.c index 3531e52ed..3780939f4 100644 --- a/src/stream.c +++ b/src/stream.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -58,7 +59,6 @@ #include #include #include -#include #include DECLARE_POOL(pool_head_stream, "stream", sizeof(struct stream)); diff --git a/src/stream_interface.c b/src/stream_interface.c index bd991de2d..23f639fb3 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -33,7 +34,6 @@ #include #include #include -#include #include diff --git a/src/task.c b/src/task.c index 24c3b3e54..f055ebb2b 100644 --- a/src/task.c +++ b/src/task.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -24,7 +25,6 @@ #include #include #include -#include DECLARE_POOL(pool_head_task, "task", sizeof(struct task)); DECLARE_POOL(pool_head_tasklet, "tasklet", sizeof(struct tasklet)); diff --git a/src/tools.c b/src/tools.c index 6dda8aa9a..fd7779555 100644 --- a/src/tools.c +++ b/src/tools.c @@ -46,12 +46,12 @@ #include #include #include +#include #include #include #include #include #include -#include /* This macro returns false if the test __x is false. Many * of the following parsing function must be abort the processing