]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: http: fix http-reuse when frontend and backend differ
authorWilly Tarreau <w@1wt.eu>
Mon, 7 Dec 2015 16:04:59 +0000 (17:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 7 Dec 2015 16:04:59 +0000 (17:04 +0100)
commit858b103631db41c608660210eb37a9e09ee9f086
tree0eeea4c3f6cbe9ecc4bfc06769d6ea3caf6d694d
parentbaf9794b4d1e8590f88426e6e905cc5a72bfc1c0
BUG/MEDIUM: http: fix http-reuse when frontend and backend differ

Krishna Kumar reported that the following configuration doesn't permit
HTTP reuse between two clients :

    frontend private-frontend
        mode http
        bind :8001
        default_backend private-backend

    backend private-backend
        mode http
        http-reuse always
        server bck 127.0.0.1:8888

The reason for this is that in http_end_txn_clean_session() we check the
stream's backend backend's http-reuse option before deciding whether the
backend connection should be moved back to the server's pool or not. But
since we're doing this after the call to http_reset_txn(), the backend is
reset to match the frontend, which doesn't have the option. However it
will work fine in a setup involving a "listen" section.

We just need to keep a pointer to the current backend before calling
http_reset_txn(). The code does that and replaces the few remaining
references to s->be inside the same function so that if any part of
code were to be moved later, this trap doesn't happen again.

This fix must be backported to 1.6.
src/proto_http.c