]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cf-socket: move ctx declaration under HAVE_GETPEERNAME
authorhumbleacolyte <bayandin.eugene@gmail.com>
Tue, 20 Jun 2023 12:02:21 +0000 (17:02 +0500)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 21 Jun 2023 06:34:50 +0000 (08:34 +0200)
Closes #11352

lib/cf-socket.c

index 3707b2c6599643b8b224076abc503c6e1c5b2464..0be685216c5d476a603a4221333d7a564bf814e3 100644 (file)
@@ -1360,8 +1360,8 @@ out:
 static void conn_set_primary_ip(struct Curl_cfilter *cf,
                                 struct Curl_easy *data)
 {
-  struct cf_socket_ctx *ctx = cf->ctx;
 #ifdef HAVE_GETPEERNAME
+  struct cf_socket_ctx *ctx = cf->ctx;
   if(!(data->conn->handler->protocol & CURLPROTO_TFTP)) {
     /* TFTP does not connect the endpoint: getpeername() failed with errno
        107: Transport endpoint is not connected */