]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proto_htx: Fix htx_res_set_status to also set the reason
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 13 Dec 2018 20:58:18 +0000 (21:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Dec 2018 15:03:29 +0000 (16:03 +0100)
Becaue the check on the return value of the function http_replace_res_status was
done upside down, no reason was never set.

src/proto_htx.c

index 6c637cb834a8e102c48efdaa903c27ceca431902..b4bc3970dbec1df243fcc1dc929afd67708459da 100644 (file)
@@ -2727,7 +2727,7 @@ void htx_res_set_status(unsigned int status, const char *reason, struct stream *
        if (reason == NULL)
                reason = http_get_reason(status);
 
-       if (!http_replace_res_status(htx, ist2(trash.area, trash.data)))
+       if (http_replace_res_status(htx, ist2(trash.area, trash.data)))
                http_replace_res_reason(htx, ist2(reason, strlen(reason)));
 }