]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urldata: remove the duplicate 'ip_addr_str' field
authorDaniel Stenberg <daniel@haxx.se>
Tue, 26 Jan 2021 09:46:49 +0000 (10:46 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 27 Jan 2021 08:18:51 +0000 (09:18 +0100)
... as the numerical IP address is already stored and kept in 'primary_ip'.

Closes #6534

lib/connect.c
lib/ftp.c
lib/url.c
lib/urldata.h
lib/vquic/quiche.c

index 052542449a262e8d58054db6efcf442f68bffca7..b9716e274793fd2a807a7867378ce121194c6666 100644 (file)
@@ -700,7 +700,6 @@ void Curl_conninfo_remote(struct Curl_easy *data,
           errno, Curl_strerror(errno, buffer, sizeof(buffer)));
     return;
   }
-  memcpy(conn->ip_addr_str, conn->primary_ip, MAX_IPADR_LEN);
 #else
   (void)data;
   (void)conn;
index ab6685adea748774eaa2f6ca0b6e72d11d253b10..3818a9ea46bedbeca777075a09c616085e708e60 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1819,7 +1819,7 @@ static char *control_address(struct connectdata *conn)
   if(conn->bits.tunnel_proxy || conn->bits.socksproxy)
     return conn->host.name;
 #endif
-  return conn->ip_addr_str;
+  return conn->primary_ip;
 }
 
 static CURLcode ftp_state_pasv_resp(struct Curl_easy *data,
index 77117b88169eee2145edf71b44bb7d5c10cd6569..ee6285c60b90cd158bb870399ca45b8a647cdb2e 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1176,9 +1176,9 @@ ConnectionExists(struct Curl_easy *data,
         }
 
         if(Curl_resolver_asynch()) {
-          /* ip_addr_str[0] is NUL only if the resolving of the name hasn't
+          /* primary_ip[0] is NUL only if the resolving of the name hasn't
              completed yet and until then we don't re-use this connection */
-          if(!check->ip_addr_str[0]) {
+          if(!check->primary_ip[0]) {
             infof(data,
                   "Connection #%ld is still name resolving, can't reuse\n",
                   check->connection_id);
@@ -1491,7 +1491,7 @@ void Curl_verboseconnect(struct Curl_easy *data,
 #endif
           conn->bits.conn_to_host ? conn->conn_to_host.dispname :
           conn->host.dispname,
-          conn->ip_addr_str, conn->port, conn->connection_id);
+          conn->primary_ip, conn->port, conn->connection_id);
 }
 #endif
 
index 95ef175a1207440e9b7e1490f3420f45a9974658..3ab06feea6b459f86d49e299751a794ac01fb925 100644 (file)
@@ -939,11 +939,6 @@ struct connectdata {
   struct Curl_addrinfo *ip_addr;
   struct Curl_addrinfo *tempaddr[2]; /* for happy eyeballs */
 
-  /* 'ip_addr_str' is the ip_addr data as a human readable string.
-     It remains available as long as the connection does, which is longer than
-     the ip_addr itself. */
-  char ip_addr_str[MAX_IPADR_LEN];
-
   unsigned int scope_id;  /* Scope id for IPv6 */
 
   enum {
index 15f16ae3eb888ddf61c0537fc0eee79bdd6f5af9..d140d8fc0f8951432fa905644b917033ae98fbf9 100644 (file)
@@ -255,7 +255,6 @@ CURLcode Curl_quic_connect(struct Curl_easy *data,
           SOCKERRNO, Curl_strerror(SOCKERRNO, buffer, sizeof(buffer)));
     return CURLE_BAD_FUNCTION_ARGUMENT;
   }
-  memcpy(conn->ip_addr_str, conn->primary_ip, MAX_IPADR_LEN);
   Curl_persistconninfo(data, conn);
 
   /* for connection reuse purposes: */