MEDIUM: http: implement http-response track-sc* directive
This enables tracking of sticky counters from current response. The only
difference from "http-request track-sc" is the <key> sample expression
can only make use of samples in response (eg. res.*, status etc.) and
samples below Layer 6.
diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h
index 0aa6643..9cdd589 100644
--- a/include/proto/proto_http.h
+++ b/include/proto/proto_http.h
@@ -242,10 +242,10 @@
return len;
}
-/* for an http-request action ACT_HTTP_REQ_TRK_*, return a tracking index
+/* for an http-request/response action ACT_ACTION_TRK_SC*, return a tracking index
* starting at zero for SC0. Unknown actions also return zero.
*/
-static inline int http_req_trk_idx(int trk_action)
+static inline int http_trk_idx(int trk_action)
{
return trk_action - ACT_ACTION_TRK_SC0;
}
diff --git a/include/types/stick_table.h b/include/types/stick_table.h
index cab11c1..77eeccd 100644
--- a/include/types/stick_table.h
+++ b/include/types/stick_table.h
@@ -181,6 +181,16 @@
/* WARNING: if new fields are added, they must be initialized in stream_accept()
* and freed in stream_free() !
+ *
+ * What's the purpose of there two macro:
+ * - STKCTR_TRACK_BACKEND indicates that a tracking pointer was set from the backend
+ * and thus that when a keep-alive request goes to another backend, the track
+ * must cease.
+ *
+ * - STKCTR_TRACK_CONTENT indicates that the tracking pointer was set in a
+ * content-aware rule (tcp-request content or http-request) and that the
+ * tracking has to be performed in the stream and not in the session, and
+ * will cease for a new keep-alive request over the same connection.
*/
#define STKCTR_TRACK_BACKEND 1
#define STKCTR_TRACK_CONTENT 2