diff --git a/CHANGELOG b/CHANGELOG index da3392b75..bbd4d6b27 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,12 @@ ChangeLog : =========== +2003/04/16 : 1.1.19 + - haproxy was NOT RFC compliant because it was case-sensitive on HTTP + "Cookie:" and "Set-Cookie:" headers. This caused JVM 1.4 to fail on + cookie persistence because it uses "cookie:". Two memcmp() have been + replaced with strncasecmp(). + 2003/04/02 : 1.1.18 - Haproxy can be compiled with PCRE regex instead of libc regex, by setting REGEX=pcre on the make command line. @@ -64,7 +70,7 @@ ChangeLog : 2002/06/04 : 1.1.11 - fixed multi-cookie handling in client request to allow clean deletion in insert+indirect mode. Now, only the server cookie is deleted and not - all the header. Should now be compliant to RFC2109. + all the header. Should now be compliant to RFC2965. - added a "nocache" option to "cookie" to specify that we explicitly want to add a "cache-control" header when we add a cookie. It is also possible to add an "Expires: " to keep compatibility diff --git a/Makefile b/Makefile index 959d8660f..361642061 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ REGEX=libc #REGEX=pcre # This is the directory hosting include/pcre.h and lib/libpcre.* when REGEX=pcre -PCREDIR := $(shell pcre-config --prefix) +PCREDIR := $(shell pcre-config --prefix 2>/dev/null) #PCREDIR=/usr/local # This is for Linux 2.4 with netfilter diff --git a/NOTES b/NOTES deleted file mode 100644 index 78de2c16e..000000000 --- a/NOTES +++ /dev/null @@ -1,19 +0,0 @@ -1.1.5 -> 1.1.6 - * added reqdeny / reqallow rules - * added HTTP 400 and 403 responses - * chain regex in a list - * reply 502 when no server is available -1.1.6 -> 1.1.7 - * implement global logging - * have a single log function - * add x-forwarded-for - * log http requests on demand, and destination server name -1.1.7 -> 1.1.8 - * full HTTP log with destination server ID, req and resp time. - * source address of outgoing connections -1.1.8 -> 1.1.9 -1.1.9 -> 1.1.10 - * automatically remove client cookie in insert+indirect mode -1.1.10 -> 1.1.11 - * support multi-cookie as described in RFC2109 - * added "nocache" option to prevent caches from storing cookies. diff --git a/TODO b/TODO index 7d8ef742f..0eb301614 100644 --- a/TODO +++ b/TODO @@ -26,4 +26,4 @@ - differentiate http headers and http uris - support environment variables in config file - support keep-alive - +- support SSL diff --git a/examples/haproxy2html.sh b/examples/haproxy2html.sh new file mode 100644 index 000000000..e3753c72a --- /dev/null +++ b/examples/haproxy2html.sh @@ -0,0 +1,3 @@ +#!/bin/sh +#(echo ''; sed -e 's,\(ASPSESSIONID[^; ]*\),\1,g' -e 's,\(^srvhdr.*\)$,\1,' -e 's,\(^clihdr.*\)$,\1,' -e 's,\(^.*\)$,\1,' -e 's/$/
/' ; echo '') +(echo ''; tr -d '\015' | sed -e 's,\(: Cookie:.*$\),\1,gi' -e 's,\(: Set-Cookie:.*$\),\1,gi' -e 's,\(^srvhdr.*\)$,\1,i' -e 's,\(^clihdr.*\)$,\1,i' -e 's,\(^.*\)$,\1,' -e 's/$/
/' ; echo '') diff --git a/haproxy.c b/haproxy.c index 42e9e87a0..7050fefbe 100644 --- a/haproxy.c +++ b/haproxy.c @@ -7,7 +7,10 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * Pending bugs (may be not fixed because not reproduced) : + * Please refer to RFC2068 or RFC2616 for informations about HTTP protocol, and + * RFC2965 for informations about cookies usage. + * + * Pending bugs (may be not fixed because never reproduced) : * - solaris only : sometimes, an HTTP proxy with only a dispatch address causes * the proxy to terminate (no core) if the client breaks the connection during * the response. Seen on 1.1.8pre4, but never reproduced. May not be related to @@ -20,6 +23,9 @@ * TODO: * - handle properly intermediate incomplete server headers. Done ? * - handle hot-reconfiguration + * - fix client/server state transition when server is in connect or headers state + * and client suddenly disconnects. The server *should* switch to SHUT_WR, but + * still handle HTTP headers. * */ @@ -47,8 +53,8 @@ #include #endif -#define HAPROXY_VERSION "1.1.18" -#define HAPROXY_DATE "2003/04/02" +#define HAPROXY_VERSION "1.1.19" +#define HAPROXY_DATE "2003/04/16" /* this is for libc5 for example */ #ifndef TCP_NODELAY @@ -2444,7 +2450,7 @@ int process_cli(struct session *t) { */ if (!delete_header && (t->proxy->cookie_name != NULL || t->proxy->capture_name != NULL) && !(t->flags & SN_CLDENY) && (ptr >= req->h + 8) - && (memcmp(req->h, "Cookie: ", 8) == 0)) { + && (strncasecmp(req->h, "Cookie: ", 8) == 0)) { char *p1, *p2, *p3, *p4; char *del_colon, *del_cookie, *colon; int app_cookies; @@ -3119,7 +3125,7 @@ int process_srv(struct session *t) { if (!delete_header /*&& (t->proxy->options & PR_O_COOK_ANY)*/ && (t->proxy->cookie_name != NULL || t->proxy->capture_name != NULL) && (ptr >= rep->h + 12) - && (memcmp(rep->h, "Set-Cookie: ", 12) == 0)) { + && (strncasecmp(rep->h, "Set-Cookie: ", 12) == 0)) { char *p1, *p2, *p3, *p4; p1 = rep->h + 12; /* first char after 'Set-Cookie: ' */