]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: fix `-Wunused-variable` in !alt-svc !proxy !ws builds
authorViktor Szakats <commit@vsz.me>
Wed, 29 Oct 2025 13:18:11 +0000 (14:18 +0100)
committerViktor Szakats <commit@vsz.me>
Wed, 29 Oct 2025 15:17:35 +0000 (16:17 +0100)
```
lib/http.c:2783:23: error: unused variable 'conn' [-Werror,-Wunused-variable]
 2783 |   struct connectdata *conn = data->conn;
      |                       ^~~~
1 error generated.
```

Closes #19276

lib/http.c

index b8a4edef61066617a6677cc88fa6838e0e133c07..16d619951fb02168c0e17caadf274005cfcd3963 100644 (file)
@@ -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 */