From: Willy Tarreau Date: Mon, 22 Jan 2007 07:55:47 +0000 (+0100) Subject: [MAJOR] invalid header offset broke cookies and authentication X-Git-Tag: v1.3.6.1~1 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=83969f42bacc8dbe397f3c4d763c735f2c099e28;p=haproxy.git [MAJOR] invalid header offset broke cookies and authentication Since the request is no longer part of the headers, cookies and authentication did not work anymore. Obvious fix is to add the request offset to the start pointer. --- diff --git a/src/proto_http.c b/src/proto_http.c index fe5917043..94d354cba 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -3933,10 +3933,10 @@ void manage_client_side_cookies(struct session *t, struct buffer *req) /* Iterate through the headers. * we start with the start line. */ - old_idx = cur_idx = 0; - cur_next = req->data + hreq->req.sor; + old_idx = 0; + cur_next = req->data + hreq->req.sor + hdr_idx_first_pos(&hreq->hdr_idx); - while ((cur_idx = hreq->hdr_idx.v[cur_idx].next)) { + while ((cur_idx = hreq->hdr_idx.v[old_idx].next)) { struct hdr_idx_elem *cur_hdr; cur_hdr = &hreq->hdr_idx.v[cur_idx]; @@ -4380,7 +4380,7 @@ int stats_check_uri_auth(struct session *t, struct proxy *backend) /* FIXME: this should move to an earlier place */ cur_idx = 0; - h = t->req->data + hreq->req.sor; + h = t->req->data + hreq->req.sor + hdr_idx_first_pos(&hreq->hdr_idx); while ((cur_idx = hreq->hdr_idx.v[cur_idx].next)) { int len = hreq->hdr_idx.v[cur_idx].len; if (len > 14 &&