MINOR: sample: add a rand() sample fetch to return a sample.
Sometimes it can be useful to generate a random value, at least
for debugging purposes, but also to take routing decisions or to
pass such a value to a backend server.
diff --git a/src/haproxy.c b/src/haproxy.c
index 45d1bd7..2b83c62 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -523,6 +523,8 @@
tv_update_date(-1,-1);
start_date = now;
+ srandom(now_ms - getpid());
+
/* Get the numeric timezone. */
get_localtime(start_date.tv_sec, &curtime);
strftime(localtimezone, 6, "%z", &curtime);