From: willy tarreau Date: Wed, 10 May 2006 02:27:21 +0000 (+0200) Subject: [MEDIUM] in the request, always consider empty cookies as invalid. X-Git-Tag: v1.2.13~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=422bb2e79ff60c3e78ce7cfb5876d9ce11c4714c;p=thirdparty%2Fhaproxy.git [MEDIUM] in the request, always consider empty cookies as invalid. This solves a problem of unwanted stickyness to backup servers when some clients incidentely memorize an empty cookie. --- diff --git a/haproxy.c b/haproxy.c index 0ca75caba5..bdcb58232d 100644 --- a/haproxy.c +++ b/haproxy.c @@ -4082,7 +4082,13 @@ int process_cli(struct session *t) { /* Here, we'll look for the first running server which supports the cookie. * This allows to share a same cookie between several servers, for example * to dedicate backup servers to specific servers only. + * However, to prevent clients from sticking to cookie-less backup server + * when they have incidentely learned an empty cookie, we simply ignore + * empty cookies and mark them as invalid. */ + if (delim == p3) + srv = NULL; + while (srv) { if ((srv->cklen == delim - p3) && !memcmp(p3, srv->cookie, delim - p3)) { if (srv->state & SRV_RUNNING || t->proxy->options & PR_O_PERSIST) {