With the patch :) Thierry
On Sun, 26 Apr 2015 18:22:09 +0200 Thierry FOURNIER <[email protected]> wrote: > Hi, > > The bug seems to be fixed, can you try the attached path ? > > Thierry FOURNIER > > On Sat, 25 Apr 2015 09:32:33 +0200 > Thierry FOURNIER <[email protected]> wrote: > > > Hi, > > > > Thank you for the bug repport. I reproduce it, and it was a real bug. > > I look for this later. > > > > Thierry > > > > > > On Thu, 23 Apr 2015 22:42:25 +0100 > > Robert Samuel Newson <[email protected]> wrote: > > > > > Hi All, > > > > > > I’m playing with the new set-path feature and encountered a bug. I’m > > > using 1.6-dev1 plus all the patches up to Apr 22nd, I think we’re all > > > clear that set-path was not working at all in 1.6-dev1 itself. It does > > > now work but not in all situations I’d expect. > > > > > > My config is below. I do nc -lk 8000 for the backend. For the first three > > > cases, I see the right HTTP request printed there. For the fourth, > > > nothing, and haproxy generates a 503. This is true if backend.map is > > > empty (and thus the default "back" should be chosen, which does exist) or > > > it can contain valid mappings to "back" and still returns 503 for > > > requests with a matching Host header. > > > > > > > > > global > > > nbproc 1 > > > > > > defaults > > > mode http > > > log global > > > balance roundrobin > > > option httplog > > > option log-health-checks > > > option log-separate-errors > > > option forwardfor > > > option redispatch > > > retries 4 > > > option http-server-close > > > timeout client 150s > > > timeout server 1h > > > timeout connect 5s > > > timeout queue 5s > > > > > > frontend front > > > bind :9000 > > > > > > # comment out as appropriate > > > > > > # case 1: works > > > use_backend %[hdr(host),map(backend.map,back)] > > > > > > # case 2: works > > > use_backend back > > > > > > # case 3: works > > > http-request set-path /foo > > > use_backend back > > > > > > # case 4: fails (503 response, no request sent to backend) > > > # backend.map can be empty or contain a valid mapping > > > http-request set-path /foo > > > use_backend %[hdr(host),lower,map(backend.map,back)] > > > > > > backend back > > > server server1 127.0.0.1:8000 weight 10 check inter 7s > > > > > > > > >
>From 43f24de29292d7eaba2cb08c9c0ef04d276ae020 Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER <[email protected]> Date: Sun, 26 Apr 2015 18:01:40 +0200 Subject: [PATCH] BUG/MEDIUM: http: functions set-{path,query,method,uri} breaks the HTTP parser When one of these functions replaces a part of the query string by a shorter or longer new one, the header parsing is broken. This is because the start of the first header is not updated. In the same way, the total length of the request line is not updated. I dont see any bug caused by this miss, but I guess than it is better to store the good length. This bug is only in the development version. --- src/proto_http.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/proto_http.c b/src/proto_http.c index d20225a..6bb0745 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -11825,6 +11825,8 @@ int http_replace_req_line(int action, const char *replace, int len, /* commit changes and adjust end of message */ delta = buffer_replace2(s->req.buf, cur_ptr, cur_end, replace + offset, len - offset); + txn->req.sl.rq.l += delta; + txn->hdr_idx.v[0].len += delta; http_msg_move_end(&txn->req, delta); return 0; } -- 1.7.10.4

