]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: time: move a few configurable defines to defaults.h
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Oct 2021 17:36:47 +0000 (19:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Oct 2021 23:41:14 +0000 (01:41 +0200)
TV_ETERNITY, TV_ETERNITY_MS and MAX_DELAY_MS may be configured and
ought to be in defaults.h so that they can be inherited from everywhere
without including time.h and could also be redefined if neede
(particularly for MAX_DELAY_MS).

include/haproxy/defaults.h
include/haproxy/time.h

index 7547a17dac7229e955d1aedb5fdb28e70d816b27..a6337e9c39b88caa929e19628274267e3e84b834 100644 (file)
 #define MAX_POLL_EVENTS 200
 #endif
 
+/* eternity when exprimed in timeval */
+#ifndef TV_ETERNITY
+#define TV_ETERNITY     (~0UL)
+#endif
+
+/* eternity when exprimed in ms */
+#ifndef TV_ETERNITY_MS
+#define TV_ETERNITY_MS  (-1)
+#endif
+
+/* we want to be able to detect time jumps. Fix the maximum wait time to a low
+ * value so that we know the time has changed if we wait longer.
+ */
+#ifndef MAX_DELAY_MS
+#define MAX_DELAY_MS    60000
+#endif
+
 // The maximum number of connections accepted at once by a thread for a single
 // listener. It used to default to 64 divided by the number of processes but
 // the tasklet-based model is much more scalable and benefits from smaller
index bcba0f8f946770263fd7d975dd8ac844b0639e99..d1f181c7b9377dbe4e9ed2c4133afa2f13019a49 100644 (file)
 #include <haproxy/api.h>
 #include <haproxy/thread.h>
 
-/* eternity when exprimed in timeval */
-#ifndef TV_ETERNITY
-#define TV_ETERNITY     (~0UL)
-#endif
-
-/* eternity when exprimed in ms */
-#ifndef TV_ETERNITY_MS
-#define TV_ETERNITY_MS  (-1)
-#endif
-
 #define TIME_ETERNITY   (TV_ETERNITY_MS)
 
-/* we want to be able to detect time jumps. Fix the maximum wait time to a low
- * value so that we know the time has changed if we wait longer.
- */
-#define MAX_DELAY_MS    60000
-
-
 /* returns the lowest delay amongst <old> and <new>, and respects TIME_ETERNITY */
 #define MINTIME(old, new)      (((new)<0)?(old):(((old)<0||(new)<(old))?(new):(old)))
 #define SETNOW(a)              (*a=now)