]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: replace Curl_ prefix with curlx_ for functions used in servers
authorViktor Szakats <commit@vsz.me>
Wed, 12 Mar 2025 14:36:47 +0000 (15:36 +0100)
committerViktor Szakats <commit@vsz.me>
Wed, 12 Mar 2025 23:03:15 +0000 (00:03 +0100)
Closes #16689

32 files changed:
lib/altsvc.c
lib/asyn-ares.c
lib/cf-socket.c
lib/connect.c
lib/curl_addrinfo.c
lib/curl_setup.h
lib/ftp.c
lib/hostip.c
lib/hostip6.c
lib/if2ip.c
lib/inet_ntop.c
lib/inet_ntop.h
lib/inet_pton.c
lib/inet_pton.h
lib/noproxy.c
lib/smb.c
lib/socks.c
lib/strerror.c
lib/strerror.h
lib/urlapi.c
lib/vtls/gtls.c
lib/vtls/openssl.c
lib/vtls/schannel_verify.c
lib/vtls/vtls.c
tests/libtest/lib1960.c
tests/server/getpart.c
tests/server/rtspd.c
tests/server/sockfilt.c
tests/server/socksd.c
tests/server/sws.c
tests/server/tftpd.c
tests/server/util.c

index d478a874d1f2340175cbac754e307dcd9082b301..c4dca59f3d013539a9603d49e9ffed85fa8770e0 100644 (file)
@@ -261,11 +261,11 @@ static CURLcode altsvc_out(struct altsvc *as, FILE *fp)
 #ifdef USE_IPV6
   else {
     char ipv6_unused[16];
-    if(1 == Curl_inet_pton(AF_INET6, as->dst.host, ipv6_unused)) {
+    if(1 == curlx_inet_pton(AF_INET6, as->dst.host, ipv6_unused)) {
       dst6_pre = "[";
       dst6_post = "]";
     }
-    if(1 == Curl_inet_pton(AF_INET6, as->src.host, ipv6_unused)) {
+    if(1 == curlx_inet_pton(AF_INET6, as->src.host, ipv6_unused)) {
       src6_pre = "[";
       src6_post = "]";
     }
index b15b3e197ffc5d6c5d7d5588ee721a7c2d3c33e4..08de7341c3957856bca17998728cf230e4d2fb3d 100644 (file)
@@ -932,7 +932,7 @@ CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data,
     a4.s_addr = 0; /* disabled: do not bind to a specific address */
   }
   else {
-    if(Curl_inet_pton(AF_INET, local_ip4, &a4) != 1) {
+    if(curlx_inet_pton(AF_INET, local_ip4, &a4) != 1) {
       DEBUGF(infof(data, "bad DNS IPv4 address"));
       return CURLE_BAD_FUNCTION_ARGUMENT;
     }
@@ -960,7 +960,7 @@ CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
     memset(a6, 0, sizeof(a6));
   }
   else {
-    if(Curl_inet_pton(AF_INET6, local_ip6, a6) != 1) {
+    if(curlx_inet_pton(AF_INET6, local_ip6, a6) != 1) {
       DEBUGF(infof(data, "bad DNS IPv6 address"));
       return CURLE_BAD_FUNCTION_ARGUMENT;
     }
index 4fe0315bc9c38cb0414eceeb01a0d901f2ebc772..260b52333d2018262098ec6ae26859a7e5b90b2c 100644 (file)
@@ -721,7 +721,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
         if(scope_ptr)
           *(scope_ptr++) = '\0';
 #endif
-        if(Curl_inet_pton(AF_INET6, myhost, &si6->sin6_addr) > 0) {
+        if(curlx_inet_pton(AF_INET6, myhost, &si6->sin6_addr) > 0) {
           si6->sin6_family = AF_INET6;
           si6->sin6_port = htons(port);
 #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
@@ -744,7 +744,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
 #endif
       /* IPv4 address */
       if((af == AF_INET) &&
-         (Curl_inet_pton(AF_INET, myhost, &si4->sin_addr) > 0)) {
+         (curlx_inet_pton(AF_INET, myhost, &si4->sin_addr) > 0)) {
         si4->sin_family = AF_INET;
         si4->sin_port = htons(port);
         sizeof_sa = sizeof(struct sockaddr_in);
index 076e67c579bc946d507544d4f025b761feb02fd4..327a6c36d8cc1ee38dc3182ef4c65c5f925d7738 100644 (file)
@@ -254,7 +254,7 @@ addr_next_match(const struct Curl_addrinfo *addr, int family)
 }
 
 /* retrieves ip address and port from a sockaddr structure.
-   note it calls Curl_inet_ntop which sets errno on fail, not SOCKERRNO. */
+   note it calls curlx_inet_ntop which sets errno on fail, not SOCKERRNO. */
 bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
                       char *addr, int *port)
 {
@@ -271,8 +271,8 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
   switch(sa->sa_family) {
     case AF_INET:
       si = (struct sockaddr_in *)(void *) sa;
-      if(Curl_inet_ntop(sa->sa_family, &si->sin_addr,
-                        addr, MAX_IPADR_LEN)) {
+      if(curlx_inet_ntop(sa->sa_family, &si->sin_addr,
+                         addr, MAX_IPADR_LEN)) {
         unsigned short us_port = ntohs(si->sin_port);
         *port = us_port;
         return TRUE;
@@ -281,8 +281,8 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
 #ifdef USE_IPV6
     case AF_INET6:
       si6 = (struct sockaddr_in6 *)(void *) sa;
-      if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr,
-                        addr, MAX_IPADR_LEN)) {
+      if(curlx_inet_ntop(sa->sa_family, &si6->sin6_addr,
+                         addr, MAX_IPADR_LEN)) {
         unsigned short us_port = ntohs(si6->sin6_port);
         *port = us_port;
         return TRUE;
index 39cff02f3c66306fc227c26188215ad8fe3d1313..d7b98f468c8fd1e3b1d7fa4c289ebaf64a33efaf 100644 (file)
@@ -430,13 +430,13 @@ Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port)
 struct Curl_addrinfo *Curl_str2addr(char *address, int port)
 {
   struct in_addr in;
-  if(Curl_inet_pton(AF_INET, address, &in) > 0)
+  if(curlx_inet_pton(AF_INET, address, &in) > 0)
     /* This is a dotted IP address 123.123.123.123-style */
     return Curl_ip2addr(AF_INET, &in, address, port);
 #ifdef USE_IPV6
   {
     struct in6_addr in6;
-    if(Curl_inet_pton(AF_INET6, address, &in6) > 0)
+    if(curlx_inet_pton(AF_INET6, address, &in6) > 0)
       /* This is a dotted IPv6 address ::1-style */
       return Curl_ip2addr(AF_INET6, &in6, address, port);
   }
index f9c062b06040ee5f1e076f8e4f1266146f8d9db1..86c8cb07b6d05595e9af66f9c40116e8353fb4b5 100644 (file)
 #endif
 
 #ifdef _WIN32
-#define Curl_getpid() GetCurrentProcessId()
+#define curlx_getpid() GetCurrentProcessId()
 #else
-#define Curl_getpid() getpid()
+#define curlx_getpid() getpid()
 #endif
 
 /*
index b13d4c0a3fee5038fb6666bc2ab458f5db2fe5ab..849254f451cb492616f0bcf3e188fe3b455d31ee 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -913,7 +913,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data,
           /* either ipv6 or (ipv4|domain|interface):port(-range) */
           addrlen = ip_end - string_ftpport;
 #ifdef USE_IPV6
-          if(Curl_inet_pton(AF_INET6, string_ftpport, &sa6->sin6_addr) == 1) {
+          if(curlx_inet_pton(AF_INET6, string_ftpport, &sa6->sin6_addr) == 1) {
             /* ipv6 */
             port_min = port_max = 0;
             ip_end = NULL; /* this got no port ! */
@@ -999,11 +999,11 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data,
     switch(sa->sa_family) {
 #ifdef USE_IPV6
     case AF_INET6:
-      r = Curl_inet_ntop(sa->sa_family, &sa6->sin6_addr, hbuf, sizeof(hbuf));
+      r = curlx_inet_ntop(sa->sa_family, &sa6->sin6_addr, hbuf, sizeof(hbuf));
       break;
 #endif
     default:
-      r = Curl_inet_ntop(sa->sa_family, &sa4->sin_addr, hbuf, sizeof(hbuf));
+      r = curlx_inet_ntop(sa->sa_family, &sa4->sin_addr, hbuf, sizeof(hbuf));
       break;
     }
     if(!r) {
index d92999a65049a5835c7a61c1ef40d75b254bcb73..26b20574790ee4e3909667d85da49c79a4d17288 100644 (file)
@@ -145,14 +145,14 @@ void Curl_printable_address(const struct Curl_addrinfo *ai, char *buf,
   case AF_INET: {
     const struct sockaddr_in *sa4 = (const void *)ai->ai_addr;
     const struct in_addr *ipaddr4 = &sa4->sin_addr;
-    (void)Curl_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize);
+    (void)curlx_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize);
     break;
   }
 #ifdef USE_IPV6
   case AF_INET6: {
     const struct sockaddr_in6 *sa6 = (const void *)ai->ai_addr;
     const struct in6_addr *ipaddr6 = &sa6->sin6_addr;
-    (void)Curl_inet_ntop(ai->ai_family, (const void *)ipaddr6, buf, bufsize);
+    (void)curlx_inet_ntop(ai->ai_family, (const void *)ipaddr6, buf, bufsize);
     break;
   }
 #endif
@@ -549,7 +549,7 @@ static struct Curl_addrinfo *get_localhost6(int port, const char *name)
   sa6.sin6_scope_id = 0;
 #endif
 
-  (void)Curl_inet_pton(AF_INET6, "::1", ipv6);
+  (void)curlx_inet_pton(AF_INET6, "::1", ipv6);
   memcpy(&sa6.sin6_addr, ipv6, sizeof(ipv6));
 
   ca->ai_flags     = 0;
@@ -583,7 +583,7 @@ static struct Curl_addrinfo *get_localhost(int port, const char *name)
   memset(&sa, 0, sizeof(sa));
   sa.sin_family = AF_INET;
   sa.sin_port = htons(port16);
-  if(Curl_inet_pton(AF_INET, "127.0.0.1", (char *)&ipv4) < 1)
+  if(curlx_inet_pton(AF_INET, "127.0.0.1", (char *)&ipv4) < 1)
     return NULL;
   memcpy(&sa.sin_addr, &ipv4, sizeof(ipv4));
 
@@ -651,9 +651,9 @@ bool Curl_host_is_ipnum(const char *hostname)
 #ifdef USE_IPV6
   struct in6_addr in6;
 #endif
-  if(Curl_inet_pton(AF_INET, hostname, &in) > 0
+  if(curlx_inet_pton(AF_INET, hostname, &in) > 0
 #ifdef USE_IPV6
-     || Curl_inet_pton(AF_INET6, hostname, &in6) > 0
+     || curlx_inet_pton(AF_INET6, hostname, &in6) > 0
 #endif
     )
     return TRUE;
@@ -761,7 +761,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data,
 
 #ifndef USE_RESOLVE_ON_IPS
     /* First check if this is an IPv4 address string */
-    if(Curl_inet_pton(AF_INET, hostname, &in) > 0) {
+    if(curlx_inet_pton(AF_INET, hostname, &in) > 0) {
       /* This is a dotted IP address 123.123.123.123-style */
       addr = Curl_ip2addr(AF_INET, &in, hostname, port);
       if(!addr)
@@ -771,7 +771,7 @@ enum resolve_t Curl_resolv(struct Curl_easy *data,
     else {
       struct in6_addr in6;
       /* check if this is an IPv6 address string */
-      if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0) {
+      if(curlx_inet_pton(AF_INET6, hostname, &in6) > 0) {
         /* This is an IPv6 address literal */
         addr = Curl_ip2addr(AF_INET6, &in6, hostname, port);
         if(!addr)
@@ -783,14 +783,14 @@ enum resolve_t Curl_resolv(struct Curl_easy *data,
 #else /* if USE_RESOLVE_ON_IPS */
 #ifndef CURL_DISABLE_DOH
     /* First check if this is an IPv4 address string */
-    if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
+    if(curlx_inet_pton(AF_INET, hostname, &in) > 0)
       /* This is a dotted IP address 123.123.123.123-style */
       ipnum = TRUE;
 #ifdef USE_IPV6
     else {
       struct in6_addr in6;
       /* check if this is an IPv6 address string */
-      if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0)
+      if(curlx_inet_pton(AF_INET6, hostname, &in6) > 0)
         /* This is an IPv6 address literal */
         ipnum = TRUE;
     }
index c16ddfe58d1d17a6e75bf019629bf749e5973db6..7c68c40c9c30969c6b206c5365098d16b3aa7503 100644 (file)
@@ -126,8 +126,8 @@ struct Curl_addrinfo *Curl_getaddrinfo(struct Curl_easy *data,
    * The AI_NUMERICHOST must not be set to get synthesized IPv6 address from
    * an IPv4 address on iOS and macOS.
    */
-  if((1 == Curl_inet_pton(AF_INET, hostname, addrbuf)) ||
-     (1 == Curl_inet_pton(AF_INET6, hostname, addrbuf))) {
+  if((1 == curlx_inet_pton(AF_INET, hostname, addrbuf)) ||
+     (1 == curlx_inet_pton(AF_INET6, hostname, addrbuf))) {
     /* the given address is numerical only, prevent a reverse lookup */
     hints.ai_flags = AI_NUMERICHOST;
   }
index 5b1f2d209cae15e50619d65f22b96b83d2a4cb95..7792fa6c4b427c22d7e8235285e7b084fbbc9a7e 100644 (file)
@@ -162,7 +162,7 @@ if2ip_result_t Curl_if2ip(int af,
               addr =
                 &((struct sockaddr_in *)(void *)iface->ifa_addr)->sin_addr;
             res = IF2IP_FOUND;
-            ip = Curl_inet_ntop(af, addr, ipstr, sizeof(ipstr));
+            ip = curlx_inet_ntop(af, addr, ipstr, sizeof(ipstr));
             msnprintf(buf, buf_size, "%s%s", ip, scope);
             break;
           }
@@ -235,7 +235,7 @@ if2ip_result_t Curl_if2ip(int af,
 
   s = (struct sockaddr_in *)(void *)&req.ifr_addr;
   memcpy(&in, &s->sin_addr, sizeof(in));
-  r = Curl_inet_ntop(s->sin_family, &in, buf, buf_size);
+  r = curlx_inet_ntop(s->sin_family, &in, buf, buf_size);
 
   sclose(dummy);
   if(!r)
index f666f55c8893055689ffb3598e64a01f7ac7f34f..51126ce9c4ca35ab20793e702ef17eea8ff2ade0 100644 (file)
@@ -189,7 +189,7 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size)
  * code. This is to avoid losing the actual last Winsock error. When this
  * function returns NULL, check errno not SOCKERRNO.
  */
-char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size)
+char *curlx_inet_ntop(int af, const void *src, char *buf, size_t size)
 {
   switch(af) {
   case AF_INET:
index 84e5eb277aebab420210ecc6913e456b5d7dc3d5..97d5adedb51265d342524e12cd8b6193f1a572c6 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "curl_setup.h"
 
-char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size);
+char *curlx_inet_ntop(int af, const void *addr, char *buf, size_t size);
 
 #ifdef HAVE_INET_NTOP
 #ifdef HAVE_NETINET_IN_H
@@ -39,11 +39,11 @@ char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size);
 #include <arpa/inet.h>
 #endif
 #ifdef __AMIGA__
-#define Curl_inet_ntop(af,addr,buf,size) \
+#define curlx_inet_ntop(af,addr,buf,size) \
         (char *)inet_ntop(af, CURL_UNCONST(addr), (unsigned char *)buf, \
                           (curl_socklen_t)(size))
 #else
-#define Curl_inet_ntop(af,addr,buf,size) \
+#define curlx_inet_ntop(af,addr,buf,size) \
         inet_ntop(af, addr, buf, (curl_socklen_t)(size))
 #endif
 #endif
index ad9fe4da0b121d2891668768b1bebbb18ab19168..7531f719c73de87f7b03e2cd14344da80dfe0c88 100644 (file)
@@ -72,7 +72,7 @@ static int      inet_pton6(const char *src, unsigned char *dst);
  *      Paul Vixie, 1996.
  */
 int
-Curl_inet_pton(int af, const char *src, void *dst)
+curlx_inet_pton(int af, const char *src, void *dst)
 {
   switch(af) {
   case AF_INET:
index 9d78ce9ecf772b631d3e2586f339a2cc53b92b85..fa6ee7a0ba67360b0b74e8e02f7925e81108801b 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "curl_setup.h"
 
-int Curl_inet_pton(int, const char *, void *);
+int curlx_inet_pton(int, const char *, void *);
 
 #ifdef HAVE_INET_PTON
 #ifdef HAVE_NETINET_IN_H
@@ -39,9 +39,9 @@ int Curl_inet_pton(int, const char *, void *);
 #include <arpa/inet.h>
 #endif
 #ifdef __AMIGA__
-#define Curl_inet_pton(x,y,z) inet_pton(x,(unsigned char *)CURL_UNCONST(y),z)
+#define curlx_inet_pton(x,y,z) inet_pton(x,(unsigned char *)CURL_UNCONST(y),z)
 #else
-#define Curl_inet_pton(x,y,z) inet_pton(x,y,z)
+#define curlx_inet_pton(x,y,z) inet_pton(x,y,z)
 #endif
 #endif
 
index d8cf1ddd74d17431a0c062b4acbac9d54e83feac..e0838b8762661e5b351a6686d679049b1b047793 100644 (file)
@@ -54,9 +54,9 @@ UNITTEST bool Curl_cidr4_match(const char *ipv4,    /* 1.2.3.4 address */
     /* strange input */
     return FALSE;
 
-  if(1 != Curl_inet_pton(AF_INET, ipv4, &address))
+  if(1 != curlx_inet_pton(AF_INET, ipv4, &address))
     return FALSE;
-  if(1 != Curl_inet_pton(AF_INET, network, &check))
+  if(1 != curlx_inet_pton(AF_INET, network, &check))
     return FALSE;
 
   if(bits && (bits != 32)) {
@@ -92,9 +92,9 @@ UNITTEST bool Curl_cidr6_match(const char *ipv6,
   rest = bits & 0x07;
   if((bytes > 16) || ((bytes == 16) && rest))
     return FALSE;
-  if(1 != Curl_inet_pton(AF_INET6, ipv6, address))
+  if(1 != curlx_inet_pton(AF_INET6, ipv6, address))
     return FALSE;
-  if(1 != Curl_inet_pton(AF_INET6, network, check))
+  if(1 != curlx_inet_pton(AF_INET6, network, check))
     return FALSE;
   if(bytes && memcmp(address, check, bytes))
     return FALSE;
@@ -163,7 +163,7 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy)
     else {
       unsigned int address;
       namelen = strlen(name);
-      if(1 == Curl_inet_pton(AF_INET, name, &address))
+      if(1 == curlx_inet_pton(AF_INET, name, &address))
         type = TYPE_IPV4;
       else {
         /* ignore trailing dots in the hostname */
index 35fd93401e9c1581d5870778b8eedf50ac07dfb1..164b7951d83edc9a569ec39e644e080b201cf9cb 100644 (file)
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -544,7 +544,7 @@ static void smb_format_message(struct Curl_easy *data, struct smb_header *h,
   h->flags2 = smb_swap16(SMB_FLAGS2_IS_LONG_NAME | SMB_FLAGS2_KNOWS_LONG_NAME);
   h->uid = smb_swap16(smbc->uid);
   h->tid = smb_swap16(req->tid);
-  pid = (unsigned int)Curl_getpid();
+  pid = (unsigned int)curlx_getpid();
   h->pid_high = smb_swap16((unsigned short)(pid >> 16));
   h->pid = smb_swap16((unsigned short) pid);
 }
index 0ef6b140ae4b301d7371279b3c2b76919e3425a1..3a88f0b38679d377261a136a6518d4c6f5be62e6 100644 (file)
@@ -911,7 +911,7 @@ CONNECT_RESOLVE_REMOTE:
 #ifdef USE_IPV6
       if(conn->bits.ipv6_ip) {
         char ip6[16];
-        if(1 != Curl_inet_pton(AF_INET6, sx->hostname, ip6))
+        if(1 != curlx_inet_pton(AF_INET6, sx->hostname, ip6))
           return CURLPX_BAD_ADDRESS_TYPE;
         socksreq[len++] = 4;
         memcpy(&socksreq[len], ip6, sizeof(ip6));
@@ -919,7 +919,7 @@ CONNECT_RESOLVE_REMOTE:
       }
       else
 #endif
-      if(1 == Curl_inet_pton(AF_INET, sx->hostname, ip4)) {
+      if(1 == curlx_inet_pton(AF_INET, sx->hostname, ip4)) {
         socksreq[len++] = 1;
         memcpy(&socksreq[len], ip4, sizeof(ip4));
         len += sizeof(ip4);
index 6f0710187367a3b814e1e918fe906fd715d6e438..abbdb857e3ad061228cf7cb18834ae81a4fcc016 100644 (file)
@@ -829,7 +829,7 @@ get_winapi_error(int err, char *buf, size_t buflen)
  *
  * It may be more correct to call one of the variant functions instead:
  * Call Curl_sspi_strerror if the error code is definitely Windows SSPI.
- * Call Curl_winapi_strerror if the error code is definitely Windows API.
+ * Call curlx_winapi_strerror if the error code is definitely Windows API.
  */
 const char *Curl_strerror(int err, char *buf, size_t buflen)
 {
@@ -922,11 +922,11 @@ const char *Curl_strerror(int err, char *buf, size_t buflen)
 }
 
 /*
- * Curl_winapi_strerror:
+ * curlx_winapi_strerror:
  * Variant of Curl_strerror if the error code is definitely Windows API.
  */
 #ifdef _WIN32
-const char *Curl_winapi_strerror(DWORD err, char *buf, size_t buflen)
+const char *curlx_winapi_strerror(DWORD err, char *buf, size_t buflen)
 {
 #ifdef PRESERVE_WINDOWS_ERROR_CODE
   DWORD old_win_err = GetLastError();
index 069acfc2abd4d5320bb7e693ca40d41f3828fabc..3dd382b96a13a1a80f7154ab2a36e4c8aee05c5d 100644 (file)
@@ -30,7 +30,7 @@
 
 const char *Curl_strerror(int err, char *buf, size_t buflen);
 #ifdef _WIN32
-const char *Curl_winapi_strerror(DWORD err, char *buf, size_t buflen);
+const char *curlx_winapi_strerror(DWORD err, char *buf, size_t buflen);
 #endif
 #ifdef USE_WINDOWS_SSPI
 const char *Curl_sspi_strerror(int err, char *buf, size_t buflen);
index c8db06b1235a8a652142e464274bdc360b8f0dcc..e4266a59f06fd8a23025297504389f85485e4458 100644 (file)
@@ -513,9 +513,9 @@ static CURLUcode ipv6_parse(struct Curl_URL *u, char *hostname,
   {
     char dest[16]; /* fits a binary IPv6 address */
     hostname[hlen] = 0; /* end the address there */
-    if(1 != Curl_inet_pton(AF_INET6, hostname, dest))
+    if(1 != curlx_inet_pton(AF_INET6, hostname, dest))
       return CURLUE_BAD_IPV6;
-    if(Curl_inet_ntop(AF_INET6, dest, hostname, hlen)) {
+    if(curlx_inet_ntop(AF_INET6, dest, hostname, hlen)) {
       hlen = strlen(hostname); /* might be shorter now */
       hostname[hlen + 1] = 0;
     }
index 7f807ae9b49e2c7c42416d9a7a9c9d6676ae570e..6924140299ab0de8e00897ff736836bc986d8d65 100644 (file)
@@ -1589,10 +1589,10 @@ Curl_gtls_verifyserver(struct Curl_easy *data,
     unsigned char addrbuf[sizeof(struct use_addr)];
     size_t addrlen = 0;
 
-    if(Curl_inet_pton(AF_INET, peer->hostname, addrbuf) > 0)
+    if(curlx_inet_pton(AF_INET, peer->hostname, addrbuf) > 0)
       addrlen = 4;
 #ifdef USE_IPV6
-    else if(Curl_inet_pton(AF_INET6, peer->hostname, addrbuf) > 0)
+    else if(curlx_inet_pton(AF_INET6, peer->hostname, addrbuf) > 0)
       addrlen = 16;
 #endif
 
index 7fdf667cba2bd432574fb2f0edd2f0f784526594..1beda3133a64087b06738fb267a58c0ad1c131ce 100644 (file)
@@ -2218,14 +2218,14 @@ static CURLcode ossl_verifyhost(struct Curl_easy *data,
   hostlen = strlen(peer->hostname);
   switch(peer->type) {
   case CURL_SSL_PEER_IPV4:
-    if(!Curl_inet_pton(AF_INET, peer->hostname, &addr))
+    if(!curlx_inet_pton(AF_INET, peer->hostname, &addr))
       return CURLE_PEER_FAILED_VERIFICATION;
     target = GEN_IPADD;
     addrlen = sizeof(struct in_addr);
     break;
 #ifdef USE_IPV6
   case CURL_SSL_PEER_IPV6:
-    if(!Curl_inet_pton(AF_INET6, peer->hostname, &addr))
+    if(!curlx_inet_pton(AF_INET6, peer->hostname, &addr))
       return CURLE_PEER_FAILED_VERIFICATION;
     target = GEN_IPADD;
     addrlen = sizeof(struct in6_addr);
index ff7f5059263de6df0c1de4b95644be729b147a0e..3b9f786f1db7af1813fd6deab1aeb90aa854d63d 100644 (file)
@@ -179,7 +179,7 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store,
                 "schannel: failed to extract certificate from CA file "
                 "'%s': %s",
                 ca_file_text,
-                Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
+                curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
           result = CURLE_SSL_CACERT_BADFILE;
           more_certs = 0;
         }
@@ -208,8 +208,8 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store,
                     "schannel: failed to add certificate from CA file '%s' "
                     "to certificate store: %s",
                     ca_file_text,
-                    Curl_winapi_strerror(GetLastError(), buffer,
-                                         sizeof(buffer)));
+                    curlx_winapi_strerror(GetLastError(), buffer,
+                                          sizeof(buffer)));
               result = CURLE_SSL_CACERT_BADFILE;
               more_certs = 0;
             }
@@ -255,7 +255,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store,
     failf(data,
           "schannel: invalid path name for CA file '%s': %s",
           ca_file,
-          Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
+          curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
     result = CURLE_SSL_CACERT_BADFILE;
     goto cleanup;
   }
@@ -277,7 +277,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store,
     failf(data,
           "schannel: failed to open CA file '%s': %s",
           ca_file,
-          Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
+          curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
     result = CURLE_SSL_CACERT_BADFILE;
     goto cleanup;
   }
@@ -287,7 +287,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store,
     failf(data,
           "schannel: failed to determine size of CA file '%s': %s",
           ca_file,
-          Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
+          curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
     result = CURLE_SSL_CACERT_BADFILE;
     goto cleanup;
   }
@@ -317,7 +317,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store,
       failf(data,
             "schannel: failed to read from CA file '%s': %s",
             ca_file,
-            Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
+            curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
       result = CURLE_SSL_CACERT_BADFILE;
       goto cleanup;
     }
@@ -461,14 +461,14 @@ static bool get_num_host_info(struct num_ip_data *ip_blob,
   struct in6_addr ia6;
   bool result = FALSE;
 
-  int res = Curl_inet_pton(AF_INET, hostname, &ia);
+  int res = curlx_inet_pton(AF_INET, hostname, &ia);
   if(res) {
     ip_blob->size = sizeof(struct in_addr);
     memcpy(&ip_blob->bData.ia, &ia, sizeof(struct in_addr));
     result = TRUE;
   }
   else {
-    res = Curl_inet_pton(AF_INET6, hostname, &ia6);
+    res = curlx_inet_pton(AF_INET6, hostname, &ia6);
     if(res) {
       ip_blob->size = sizeof(struct in6_addr);
       memcpy(&ip_blob->bData.ia6, &ia6, sizeof(struct in6_addr));
@@ -805,7 +805,7 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
         if(!trust_store) {
           char buffer[STRERROR_LEN];
           failf(data, "schannel: failed to create certificate store: %s",
-                Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
+                curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
           result = CURLE_SSL_CACERT_BADFILE;
         }
         else {
@@ -853,7 +853,7 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
         char buffer[STRERROR_LEN];
         failf(data,
               "schannel: failed to create certificate chain engine: %s",
-              Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
+              curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
         result = CURLE_SSL_CACERT_BADFILE;
       }
     }
@@ -877,7 +877,7 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf,
                                 &pChainContext)) {
       char buffer[STRERROR_LEN];
       failf(data, "schannel: CertGetCertificateChain failed: %s",
-            Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
+            curlx_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
       pChainContext = NULL;
       result = CURLE_PEER_FAILED_VERIFICATION;
     }
index 2ba9165c119f6ff656e69629c21dc9776eb5a708..b44b76473d299a7bf4782c861cedf56d858638c2 100644 (file)
@@ -1191,10 +1191,10 @@ static ssl_peer_type get_peer_type(const char *hostname)
 #else
     struct in_addr addr;
 #endif
-    if(Curl_inet_pton(AF_INET, hostname, &addr))
+    if(curlx_inet_pton(AF_INET, hostname, &addr))
       return CURL_SSL_PEER_IPV4;
 #ifdef USE_IPV6
-    else if(Curl_inet_pton(AF_INET6, hostname, &addr)) {
+    else if(curlx_inet_pton(AF_INET6, hostname, &addr)) {
       return CURL_SSL_PEER_IPV6;
     }
 #endif
index 15096f226595c2e901675b0ca086a9785cf4c401..33947a71d640b3a13c33aac18e246055a17e2369 100644 (file)
@@ -90,7 +90,7 @@ CURLcode test(char *URL)
   serv_addr.sin_family = AF_INET;
   serv_addr.sin_port = htons(port);
 
-  if(Curl_inet_pton(AF_INET, libtest_arg2, &serv_addr.sin_addr) <= 0) {
+  if(curlx_inet_pton(AF_INET, libtest_arg2, &serv_addr.sin_addr) <= 0) {
     fprintf(stderr, "inet_pton failed\n");
     goto test_cleanup;
   }
index 6bf6cc5d6d5106ce2d292b5899998eef163d5945..67ac0865a4137ebd71c7375dc84a495dbe446dc1 100644 (file)
@@ -231,14 +231,14 @@ static int decodedata(char  **buf,   /* dest buffer */
     return GPE_OK;
 
   /* base64 decode the given buffer */
-  error = Curl_base64_decode(*buf, &buf64, &src_len);
+  error = curlx_base64_decode(*buf, &buf64, &src_len);
   if(error)
     return GPE_OUT_OF_MEMORY;
 
   if(!src_len) {
     /*
     ** currently there is no way to tell apart an OOM condition in
-    ** Curl_base64_decode() from zero length decoded data. For now,
+    ** curlx_base64_decode() from zero length decoded data. For now,
     ** let's just assume it is an OOM condition, currently we have
     ** no input for this function that decodes to zero length data.
     */
index b8a066c43b3cd763f30b11b0a157d08145428541..81ecf041199aa4e447914b9331475b9294d04e98 100644 (file)
@@ -1352,7 +1352,7 @@ server_cleanup:
 
   if(got_exit_signal) {
     logmsg("========> %s rtspd (port: %d pid: %ld) exits with signal (%d)",
-           ipv_inuse, (int)port, (long)Curl_getpid(), exit_signal);
+           ipv_inuse, (int)port, (long)curlx_getpid(), exit_signal);
     /*
      * To properly set the return status of the process we
      * must raise the same signal SIGINT or SIGTERM that we
index 305065c10e95c58cc903b9fecee4c3343fa092fc..6dfd52b82be92a8d8052298282f6921aba2e4844 100644 (file)
@@ -1526,7 +1526,7 @@ int main(int argc, char *argv[])
       me.sa4.sin_addr.s_addr = INADDR_ANY;
       if(!addr)
         addr = "127.0.0.1";
-      Curl_inet_pton(AF_INET, addr, &me.sa4.sin_addr);
+      curlx_inet_pton(AF_INET, addr, &me.sa4.sin_addr);
 
       rc = connect(sock, &me.sa, sizeof(me.sa4));
 #ifdef USE_IPV6
@@ -1537,7 +1537,7 @@ int main(int argc, char *argv[])
       me.sa6.sin6_port = htons(server_connectport);
       if(!addr)
         addr = "::1";
-      Curl_inet_pton(AF_INET6, addr, &me.sa6.sin6_addr);
+      curlx_inet_pton(AF_INET6, addr, &me.sa6.sin6_addr);
 
       rc = connect(sock, &me.sa, sizeof(me.sa6));
     }
index ffa2e6eb9e68bca29cd11f8019d08a4c56055c4a..5d529f60d12d7e3d43ebc5738ac7f28f73067d09 100644 (file)
@@ -231,7 +231,7 @@ static curl_socket_t socksconnect(unsigned short connectport,
   me.sa4.sin_family = AF_INET;
   me.sa4.sin_port = htons(connectport);
   me.sa4.sin_addr.s_addr = INADDR_ANY;
-  Curl_inet_pton(AF_INET, connectaddr, &me.sa4.sin_addr);
+  curlx_inet_pton(AF_INET, connectaddr, &me.sa4.sin_addr);
 
   rc = connect(sock, &me.sa, sizeof(me.sa4));
 
index 5a1d46a07baac35cf0f6c3b4b3ab04639fa3a2bb..19a287f0ae668220ebc896ef241f5dce35f64675 100644 (file)
@@ -1300,7 +1300,7 @@ static curl_socket_t connect_to(const char *ipaddr, unsigned short port)
     memset(&serveraddr.sa4, 0, sizeof(serveraddr.sa4));
     serveraddr.sa4.sin_family = AF_INET;
     serveraddr.sa4.sin_port = htons(port);
-    if(Curl_inet_pton(AF_INET, ipaddr, &serveraddr.sa4.sin_addr) < 1) {
+    if(curlx_inet_pton(AF_INET, ipaddr, &serveraddr.sa4.sin_addr) < 1) {
       logmsg("Error inet_pton failed AF_INET conversion of '%s'", ipaddr);
       sclose(serverfd);
       return CURL_SOCKET_BAD;
@@ -1313,7 +1313,7 @@ static curl_socket_t connect_to(const char *ipaddr, unsigned short port)
     memset(&serveraddr.sa6, 0, sizeof(serveraddr.sa6));
     serveraddr.sa6.sin6_family = AF_INET6;
     serveraddr.sa6.sin6_port = htons(port);
-    if(Curl_inet_pton(AF_INET6, ipaddr, &serveraddr.sa6.sin6_addr) < 1) {
+    if(curlx_inet_pton(AF_INET6, ipaddr, &serveraddr.sa6.sin6_addr) < 1) {
       logmsg("Error inet_pton failed AF_INET6 conversion of '%s'", ipaddr);
       sclose(serverfd);
       return CURL_SOCKET_BAD;
@@ -2509,7 +2509,7 @@ sws_cleanup:
 
   if(got_exit_signal) {
     logmsg("========> %s sws (%s pid: %ld) exits with signal (%d)",
-           socket_type, location_str, (long)Curl_getpid(), exit_signal);
+           socket_type, location_str, (long)curlx_getpid(), exit_signal);
     /*
      * To properly set the return status of the process we
      * must raise the same signal SIGINT or SIGTERM that we
index ed81e98899c7eaf8788e0cf77815a130d1d1bcf6..8fca655990075197dbb1b3d34bd6a9711db2744c 100644 (file)
@@ -858,7 +858,7 @@ tftpd_cleanup:
 
   if(got_exit_signal) {
     logmsg("========> %s tftpd (port: %d pid: %ld) exits with signal (%d)",
-           ipv_inuse, (int)port, (long)Curl_getpid(), exit_signal);
+           ipv_inuse, (int)port, (long)curlx_getpid(), exit_signal);
     /*
      * To properly set the return status of the process we
      * must raise the same signal SIGINT or SIGTERM that we
index 26ecafd4483345f6abf1593250485481b6ea8f47..79b64c39afe2d6c7682096349cab658ad98a1fe1 100644 (file)
@@ -173,7 +173,7 @@ static void win32_perror(const char *msg)
 {
   char buf[512];
   int err = SOCKERRNO;
-  Curl_winapi_strerror(err, buf, sizeof(buf));
+  curlx_winapi_strerror(err, buf, sizeof(buf));
   if(msg)
     fprintf(stderr, "%s: ", msg);
   fprintf(stderr, "%s\n", buf);
@@ -224,7 +224,7 @@ int win32_init(void)
 const char *sstrerror(int err)
 {
   static char buf[512];
-  return Curl_winapi_strerror(err, buf, sizeof(buf));
+  return curlx_winapi_strerror(err, buf, sizeof(buf));
 }
 #endif  /* _WIN32 */
 
@@ -299,7 +299,7 @@ curl_off_t our_getpid(void)
 {
   curl_off_t pid;
 
-  pid = (curl_off_t)Curl_getpid();
+  pid = (curl_off_t)curlx_getpid();
 #ifdef _WIN32
   /* store pid + MAX_PID to avoid conflict with Cygwin/msys PIDs, see also:
    * - 2019-01-31: https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵