]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: http/htx: unbreak option http_proxy
authorWilly Tarreau <w@1wt.eu>
Thu, 18 Jul 2019 14:17:15 +0000 (16:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 18 Jul 2019 14:49:11 +0000 (16:49 +0200)
The temporary connection used to hold the target connection's address
was missing a valid target, resulting in a 500 server error being
reported when trying to connect to a remote host. Strangely this
issue was introduced as a side effect of commit 2c52a2b9e ("MEDIUM:
connection: make mux->detach() release the connection") which at
first glance looks unrelated but solidly stops the bisection (note
that by default this part even crashes). It's suspected that the
error only happens when closing and destroys pending data in fact.

Given that this feature was broken very early during 1.8-rc1 development
it doesn't seem to be used often. This must be backported as far as 1.8.

src/proto_http.c
src/proto_htx.c

index 35f86ef1dd20c2c75367cbed56a944c2c9199170..f77d7bc488829212100292d9bebe2b2b83e5bc9b 100644 (file)
@@ -2886,6 +2886,7 @@ int http_process_request(struct stream *s, struct channel *req, int an_bit)
                        if (http_parse_reqline(&txn->req, HTTP_MSG_RQMETH,  cur_ptr, cur_end + 1, NULL, NULL) == NULL)
                                goto return_bad_req;
                }
+               conn->target = &s->be->obj_type;
        }
 
        /*
index 59b0ff975ac503a4373ba3ebebe911d4c0f79b6a..620f81b75620b7fc877b70fca5af9a3d117912b9 100644 (file)
@@ -805,6 +805,7 @@ int htx_process_request(struct stream *s, struct channel *req, int an_bit)
                 * insignificant.
                 */
                istcpy(&uri, (path.len ? path : ist("/")), uri.len);
+               conn->target = &s->be->obj_type;
        }
 
        /*