From: Daniel Stenberg Date: Mon, 10 Nov 2025 00:02:37 +0000 (+0100) Subject: setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c791223743d227bb0773fc4d2b723404b0fdda96;p=thirdparty%2Fcurl.git setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL As documented. Reported-by: Stanislav Fort (Aisle Research) Closes #19434 --- diff --git a/lib/setopt.c b/lib/setopt.c index 90a1cf24a8..67b5371e87 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2169,8 +2169,9 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * Set the client IP to send through HAProxy PROXY protocol */ result = Curl_setstropt(&s->str[STRING_HAPROXY_CLIENT_IP], ptr); - /* enable the HAProxy protocol */ - s->haproxyprotocol = TRUE; + + /* enable the HAProxy protocol if an IP is provided */ + s->haproxyprotocol = !!s->str[STRING_HAPROXY_CLIENT_IP]; break; #endif