From: Viktor Szakats Date: Wed, 29 Oct 2025 13:18:11 +0000 (+0100) Subject: http: fix `-Wunused-variable` in !alt-svc !proxy !ws builds X-Git-Tag: curl-8_17_0~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25aee8648ab1c8c5db03db0d3494523491511772;p=thirdparty%2Fcurl.git http: fix `-Wunused-variable` in !alt-svc !proxy !ws builds ``` lib/http.c:2783:23: error: unused variable 'conn' [-Werror,-Wunused-variable] 2783 | struct connectdata *conn = data->conn; | ^~~~ 1 error generated. ``` Closes #19276 --- diff --git a/lib/http.c b/lib/http.c index b8a4edef61..16d619951f 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2780,7 +2780,11 @@ static CURLcode http_add_hd(struct Curl_easy *data, Curl_HttpReq httpreq) { CURLcode result = CURLE_OK; +#if !defined(CURL_DISABLE_ALTSVC) || \ + !defined(CURL_DISABLE_PROXY) || \ + !defined(CURL_DISABLE_WEBSOCKETS) struct connectdata *conn = data->conn; +#endif switch(id) { case H1_HD_REQUEST: /* add the main request stuff */