From: Willy Tarreau Date: Thu, 7 Oct 2010 13:28:23 +0000 (+0200) Subject: [MINOR] cookie: add the expired (E) and old (O) flags for request cookies X-Git-Tag: v1.5-dev8~446 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b761ec4c94d7bf32621f65ed9e0841f8e32e4397;p=thirdparty%2Fhaproxy.git [MINOR] cookie: add the expired (E) and old (O) flags for request cookies These flags will indicate the cookie status when an expiration date is set. (cherry picked from commit 3f0f0e4583a432d34b75bc7b9dd2c756b4e181a7) --- diff --git a/include/types/proto_http.h b/include/types/proto_http.h index eebafc5d24..5ee2e0fd47 100644 --- a/include/types/proto_http.h +++ b/include/types/proto_http.h @@ -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 */ diff --git a/src/proto_http.c b/src/proto_http.c index bf81196a86..71f5af5994 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -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 */