diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-03-06 19:26:47 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-03-06 19:26:47 +0000 |
commit | 41830b96c1b5144beab9858f74e2881634f915d2 (patch) | |
tree | 5abf219d5b6d1539f2f63be3d6281e9991a678dc /usr.sbin/relayd/parse.y | |
parent | 0cb27c3402077630224ff3f8ea8968e2e2c8f985 (diff) |
add support for handling simple HTTP cookies (no per-path/domain
cookies yet), for example: cookie hash "JSESSIONID"
tested by some people
ok pyr@
Diffstat (limited to 'usr.sbin/relayd/parse.y')
-rw-r--r-- | usr.sbin/relayd/parse.y | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y index 8fa77d94e08..18cfa36c18c 100644 --- a/usr.sbin/relayd/parse.y +++ b/usr.sbin/relayd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.33 2007/02/27 13:38:58 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.34 2007/03/06 19:26:46 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -107,7 +107,7 @@ typedef struct { %token CHECK TCP ICMP EXTERNAL REQUEST RESPONSE %token TIMEOUT CODE DIGEST PORT TAG INTERFACE %token VIRTUAL INTERVAL DISABLE STICKYADDR BACKLOG -%token SEND EXPECT NOTHING SSL LOADBALANCE ROUNDROBIN CIPHERS +%token SEND EXPECT NOTHING SSL LOADBALANCE ROUNDROBIN CIPHERS COOKIE %token RELAY LISTEN ON FORWARD TO NAT LOOKUP PREFORK NO MARK MARKED %token PROTO SESSION CACHE APPEND CHANGE REMOVE FROM FILTER HASH HEADER %token LOG UPDATES ALL DEMOTE NODELAY SACK SOCKET BUFFER URL RETRY @@ -606,15 +606,18 @@ protoptsl : SSL sslflags } RB_INSERT(proto_tree, tree, pn); - if (node.type != NODE_TYPE_HEADER) { + if (node.type == NODE_TYPE_COOKIE) + pk.key = "Cookie"; + else pk.key = "GET"; + if (node.type != NODE_TYPE_HEADER) { pk.type = NODE_TYPE_HEADER; pn = RB_FIND(proto_tree, tree, &pk); if (pn == NULL) { if ((pn = (struct protonode *) calloc(1, sizeof(*pn))) == NULL) fatal("out of memory"); - pn->key = strdup("GET"); + pn->key = strdup(pk.key); if (pn->key == NULL) fatal("out of memory"); pn->value = NULL; @@ -783,6 +786,7 @@ marked : /* empty */ nodetype : HEADER { node.type = NODE_TYPE_HEADER; } | URL { node.type = NODE_TYPE_URL; } + | COOKIE { node.type = NODE_TYPE_COOKIE; } ; sslcache : number { $$ = $1; } @@ -1065,6 +1069,7 @@ lookup(char *s) { "check", CHECK }, { "ciphers", CIPHERS }, { "code", CODE }, + { "cookie", COOKIE }, { "demote", DEMOTE }, { "digest", DIGEST }, { "disable", DISABLE }, |