]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream: add sample fetches
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 10 Dec 2020 12:43:57 +0000 (13:43 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 11 Dec 2020 11:01:07 +0000 (12:01 +0100)
Prepare the possibility to register sample fetches on the stream.

This commit is necessary to implement sample fetches to retrieve the
current timeout values.

src/stream.c

index e43eace13a7d462512cf202f2963fb1a86f0955c..187d8840971f45b6912b86a8c15b0ed203b810c0 100644 (file)
@@ -48,6 +48,7 @@
 #include <haproxy/proxy.h>
 #include <haproxy/queue.h>
 #include <haproxy/server.h>
+#include <haproxy/sample.h>
 #include <haproxy/session.h>
 #include <haproxy/stats-t.h>
 #include <haproxy/stick_table.h>
@@ -3456,6 +3457,15 @@ static struct action_kw_list stream_http_keywords = { ILH, {
 
 INITCALL1(STG_REGISTER, http_req_keywords_register, &stream_http_keywords);
 
+/* Note: must not be declared <const> as its list will be overwritten.
+ * Please take care of keeping this list alphabetically sorted.
+ */
+static struct sample_fetch_kw_list smp_kws = {ILH, {
+       { NULL, NULL, 0, 0, 0 },
+}};
+
+INITCALL1(STG_REGISTER, sample_register_fetches, &smp_kws);
+
 /*
  * Local variables:
  *  c-indent-level: 8