[MEDIUM] appsession: add "len", "prefix" and "mode" options
To sum up :
- len : it's now the max number of characters for the value, preventing
garbaged results.
- a new option "prefix" is added, this allows to use dynamic cookie
names (e.g. ASPSESSIONIDXXX).
Previously in the thread, I wanted to use the value found with
"capture cookie" but when i started to update the documentation, I
found this solution quite weird. I've made a small rework to not
depend on "capture cookie".
- There's the posssiblity to define the URL parser mode (path parameters
or query string).
diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h
index 34fccdf..d5a7306 100644
--- a/include/proto/proto_http.h
+++ b/include/proto/proto_http.h
@@ -75,7 +75,7 @@
int apply_filter_to_req_line(struct session *t, struct buffer *req, struct hdr_exp *exp);
int apply_filters_to_request(struct session *t, struct buffer *req, struct hdr_exp *exp);
int apply_filters_to_response(struct session *t, struct buffer *rtr, struct hdr_exp *exp);
-void manage_client_side_appsession(struct session *t, const char *buf);
+void manage_client_side_appsession(struct session *t, const char *buf, int len);
void manage_client_side_cookies(struct session *t, struct buffer *req);
void manage_server_side_cookies(struct session *t, struct buffer *rtr);
void check_response_for_cacheability(struct session *t, struct buffer *rtr);
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 8348f92..92517ca 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -123,7 +123,15 @@
#define PR_O2_LOGHCHKS 0x00000800 /* log health checks */
#define PR_O2_INDEPSTR 0x00001000 /* independant streams, don't update rex on write */
#define PR_O2_SOCKSTAT 0x00002000 /* collect & provide separate statistics for sockets */
-#define PR_O2_AS_REQL 0x00004000 /* appsession: learn the session id from the request */
+
+/* appsession */
+#define PR_O2_AS_REQL 0x00004000 /* learn the session id from the request */
+#define PR_O2_AS_PFX 0x00008000 /* match on the cookie prefix */
+
+/* Encoding of appsession cookie matching modes : 2 possible values => 1 bit */
+#define PR_O2_AS_M_PP 0x00000000 /* path-parameters mode (the default mode) */
+#define PR_O2_AS_M_QS 0x00010000 /* query-string mode */
+#define PR_O2_AS_M_ANY 0x00010000 /* mask covering all PR_O2_AS_M_* values */
struct error_snapshot {
struct timeval when; /* date of this event, (tv_sec == 0) means "never" */