]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] cookie: add the expired (E) and old (O) flags for request cookies
authorWilly Tarreau <w@1wt.eu>
Thu, 7 Oct 2010 13:28:23 +0000 (15:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 30 Oct 2010 17:04:33 +0000 (19:04 +0200)
These flags will indicate the cookie status when an expiration date is
set.
(cherry picked from commit 3f0f0e4583a432d34b75bc7b9dd2c756b4e181a7)

include/types/proto_http.h
src/proto_http.c

index eebafc5d247e0692d3aae242474208fb85d94965..5ee2e0fd477a0a821da67dcafe8ba389c971dc80 100644 (file)
@@ -41,6 +41,8 @@
 #define TX_CK_INVALID  0x00000020      /* this session had a cookie which matches no server */
 #define TX_CK_DOWN     0x00000040      /* this session had cookie matching a down server */
 #define TX_CK_VALID    0x00000060      /* this session had cookie matching a valid server */
+#define TX_CK_EXPIRED  0x00000080      /* this session had an expired cookie (idle for too long) */
+#define TX_CK_OLD      0x000000A0      /* this session had too old a cookie (offered too long ago) */
 #define TX_CK_MASK     0x000000E0      /* mask to get this session's cookie flags */
 #define TX_CK_SHIFT    5               /* bit shift */
 
index bf81196a8671a100a911dc089a05ef77029a2ba6..71f5af5994cdac3005627e1beafa24ff2d44450b 100644 (file)
@@ -837,7 +837,7 @@ void http_return_srv_error(struct session *s, struct stream_interface *si)
 extern const char sess_term_cond[8];
 extern const char sess_fin_state[8];
 extern const char *monthname[12];
-const char sess_cookie[4]     = "NIDV";                /* No cookie, Invalid cookie, cookie for a Down server, Valid cookie */
+const char sess_cookie[8]     = "NIDVEO67";    /* No cookie, Invalid cookie, cookie for a Down server, Valid cookie, Expired cookie, Old cookie */
 const char sess_set_cookie[8] = "N1I3PD5R";    /* No set-cookie, unknown, Set-Cookie Inserted, unknown,
                                                   Set-cookie seen and left unchanged (passive), Set-cookie Deleted,
                                                   unknown, Set-cookie Rewritten */