]> granicus.if.org Git - curl/commitdiff
Renamed Curl_ascii_equal to Curl_raw_equal and bugfixed the my_toupper function
authorDaniel Stenberg <daniel@haxx.se>
Thu, 16 Oct 2008 08:23:48 +0000 (08:23 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 16 Oct 2008 08:23:48 +0000 (08:23 +0000)
used in strequal.c so now all test cases run fine for me again.

15 files changed:
lib/cookie.c
lib/curlx.h
lib/gtls.c
lib/http.c
lib/http_digest.c
lib/ldap.c
lib/netrc.c
lib/nss.c
lib/parsedate.c
lib/ssluse.c
lib/strequal.c
lib/strequal.h
lib/telnet.c
lib/url.c
src/main.c

index 2886c18a2034f1aee378e7de9801e2a9591b7d32..f2de8eaf9aa17a8870056afcef678dec59fb78c5 100644 (file)
@@ -243,14 +243,14 @@ Curl_cookie_add(struct SessionHandle *data,
             whatptr++;
           }
 
-          if(Curl_ascii_equal("path", name)) {
+          if(Curl_raw_equal("path", name)) {
             co->path=strdup(whatptr);
             if(!co->path) {
               badcookie = TRUE; /* out of memory bad */
               break;
             }
           }
-          else if(Curl_ascii_equal("domain", name)) {
+          else if(Curl_raw_equal("domain", name)) {
             /* note that this name may or may not have a preceeding dot, but
                we don't care about that, we treat the names the same anyway */
 
@@ -315,14 +315,14 @@ Curl_cookie_add(struct SessionHandle *data,
               }
             }
           }
-          else if(Curl_ascii_equal("version", name)) {
+          else if(Curl_raw_equal("version", name)) {
             co->version=strdup(whatptr);
             if(!co->version) {
               badcookie = TRUE;
               break;
             }
           }
-          else if(Curl_ascii_equal("max-age", name)) {
+          else if(Curl_raw_equal("max-age", name)) {
             /* Defined in RFC2109:
 
                Optional.  The Max-Age attribute defines the lifetime of the
@@ -341,7 +341,7 @@ Curl_cookie_add(struct SessionHandle *data,
               atoi((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0]) +
               (long)now;
           }
-          else if(Curl_ascii_equal("expires", name)) {
+          else if(Curl_raw_equal("expires", name)) {
             co->expirestr=strdup(whatptr);
             if(!co->expirestr) {
               badcookie = TRUE;
@@ -371,10 +371,10 @@ Curl_cookie_add(struct SessionHandle *data,
       else {
         if(sscanf(ptr, "%" MAX_COOKIE_LINE_TXT "[^;\r\n]",
                   what)) {
-          if(Curl_ascii_equal("secure", what)) {
+          if(Curl_raw_equal("secure", what)) {
             co->secure = TRUE;
           }
-          else if (Curl_ascii_equal("httponly", what)) {
+          else if (Curl_raw_equal("httponly", what)) {
             co->httponly = TRUE;
           }
           /* else,
@@ -498,7 +498,7 @@ Curl_cookie_add(struct SessionHandle *data,
            As far as I can see, it is set to true when the cookie says
            .domain.com and to false when the domain is complete www.domain.com
         */
-        co->tailmatch=(bool)Curl_ascii_equal(ptr, "TRUE"); /* store information */
+        co->tailmatch=(bool)Curl_raw_equal(ptr, "TRUE"); /* store information */
         break;
       case 2:
         /* It turns out, that sometimes the file format allows the path
@@ -518,7 +518,7 @@ Curl_cookie_add(struct SessionHandle *data,
         fields++; /* add a field and fall down to secure */
         /* FALLTHROUGH */
       case 3:
-        co->secure = (bool)Curl_ascii_equal(ptr, "TRUE");
+        co->secure = (bool)Curl_raw_equal(ptr, "TRUE");
         break;
       case 4:
         co->expires = curlx_strtoofft(ptr, NULL, 10);
@@ -571,11 +571,11 @@ Curl_cookie_add(struct SessionHandle *data,
   clist = c->cookies;
   replace_old = FALSE;
   while(clist) {
-    if(Curl_ascii_equal(clist->name, co->name)) {
+    if(Curl_raw_equal(clist->name, co->name)) {
       /* the names are identical */
 
       if(clist->domain && co->domain) {
-        if(Curl_ascii_equal(clist->domain, co->domain))
+        if(Curl_raw_equal(clist->domain, co->domain))
           /* The domains are identical */
           replace_old=TRUE;
       }
@@ -586,7 +586,7 @@ Curl_cookie_add(struct SessionHandle *data,
         /* the domains were identical */
 
         if(clist->path && co->path) {
-          if(Curl_ascii_equal(clist->path, co->path)) {
+          if(Curl_raw_equal(clist->path, co->path)) {
             replace_old = TRUE;
           }
           else
@@ -778,7 +778,7 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
       /* now check if the domain is correct */
       if(!co->domain ||
          (co->tailmatch && tailmatch(co->domain, host)) ||
-         (!co->tailmatch && Curl_ascii_equal(host, co->domain)) ) {
+         (!co->tailmatch && Curl_raw_equal(host, co->domain)) ) {
         /* the right part of the host matches the domain stuff in the
            cookie data */
 
index 94f277f10afc116b64996e4e8923ecd0aeea16c0..9558845e98295c4312dd973c6f78af4e01c34e0a 100644 (file)
@@ -65,7 +65,7 @@
 #define curlx_getenv curl_getenv
 #define curlx_strequal curl_strequal
 #define curlx_strnequal curl_strnequal
-#define curlx_ascii_equal Curl_ascii_equal
+#define curlx_raw_equal Curl_raw_equal
 #define curlx_mvsnprintf curl_mvsnprintf
 #define curlx_msnprintf curl_msnprintf
 #define curlx_maprintf curl_maprintf
index 17e3947c96219d4332c57f81ceda0934ed9f42f5..17f40ea7d72c816bade043007d2d2ac92f53647f 100644 (file)
@@ -223,9 +223,9 @@ static gnutls_x509_crt_fmt do_file_type(const char *type)
 {
   if(!type || !type[0])
     return GNUTLS_X509_FMT_PEM;
-  if(Curl_ascii_equal(type, "PEM"))
+  if(Curl_raw_equal(type, "PEM"))
     return GNUTLS_X509_FMT_PEM;
-  if(Curl_ascii_equal(type, "DER"))
+  if(Curl_raw_equal(type, "DER"))
     return GNUTLS_X509_FMT_DER;
   return -1;
 }
index da7972459f88771df38ff48a495409898466ae30..95ba8d0dbc4748225ed82757db52d94baae82fac 100644 (file)
@@ -613,7 +613,7 @@ http_output_auth(struct connectdata *conn,
   if(!data->state.this_is_a_follow ||
      conn->bits.netrc ||
      !data->state.first_host ||
-     Curl_ascii_equal(data->state.first_host, conn->host.name) ||
+     Curl_raw_equal(data->state.first_host, conn->host.name) ||
      data->set.http_disable_hostname_check_before_authentication) {
 
     /* Send web authentication header if needed */
@@ -2185,7 +2185,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
 
   ptr = checkheaders(data, "Host:");
   if(ptr && (!data->state.this_is_a_follow ||
-             Curl_ascii_equal(data->state.first_host, conn->host.name))) {
+             Curl_raw_equal(data->state.first_host, conn->host.name))) {
 #if !defined(CURL_DISABLE_COOKIES)
     /* If we have a given custom Host: header, we extract the host name in
        order to possibly use it for cookie reasons later on. We only allow the
index 2e774f3d4dbd2b39b8ffbd1592c652fe79cd3689..3ba01a5bcab4964d5cf80d6bf8b9bc8a797a6c48 100644 (file)
@@ -110,28 +110,28 @@ CURLdigest Curl_input_digest(struct connectdata *conn,
            */
           content[0]=0;
         }
-        if(Curl_ascii_equal(value, "nonce")) {
+        if(Curl_raw_equal(value, "nonce")) {
           d->nonce = strdup(content);
           if(!d->nonce)
             return CURLDIGEST_NOMEM;
         }
-        else if(Curl_ascii_equal(value, "stale")) {
-          if(Curl_ascii_equal(content, "true")) {
+        else if(Curl_raw_equal(value, "stale")) {
+          if(Curl_raw_equal(content, "true")) {
             d->stale = TRUE;
             d->nc = 1; /* we make a new nonce now */
           }
         }
-        else if(Curl_ascii_equal(value, "realm")) {
+        else if(Curl_raw_equal(value, "realm")) {
           d->realm = strdup(content);
           if(!d->realm)
             return CURLDIGEST_NOMEM;
         }
-        else if(Curl_ascii_equal(value, "opaque")) {
+        else if(Curl_raw_equal(value, "opaque")) {
           d->opaque = strdup(content);
           if(!d->opaque)
             return CURLDIGEST_NOMEM;
         }
-        else if(Curl_ascii_equal(value, "qop")) {
+        else if(Curl_raw_equal(value, "qop")) {
           char *tok_buf;
           /* tokenize the list and choose auth if possible, use a temporary
              clone of the buffer since strtok_r() ruins it */
@@ -140,10 +140,10 @@ CURLdigest Curl_input_digest(struct connectdata *conn,
             return CURLDIGEST_NOMEM;
           token = strtok_r(tmp, ",", &tok_buf);
           while(token != NULL) {
-            if(Curl_ascii_equal(token, "auth")) {
+            if(Curl_raw_equal(token, "auth")) {
               foundAuth = TRUE;
             }
-            else if(Curl_ascii_equal(token, "auth-int")) {
+            else if(Curl_raw_equal(token, "auth-int")) {
               foundAuthInt = TRUE;
             }
             token = strtok_r(NULL, ",", &tok_buf);
@@ -161,13 +161,13 @@ CURLdigest Curl_input_digest(struct connectdata *conn,
               return CURLDIGEST_NOMEM;
           }
         }
-        else if(Curl_ascii_equal(value, "algorithm")) {
+        else if(Curl_raw_equal(value, "algorithm")) {
           d->algorithm = strdup(content);
           if(!d->algorithm)
             return CURLDIGEST_NOMEM;
-          if(Curl_ascii_equal(content, "MD5-sess"))
+          if(Curl_raw_equal(content, "MD5-sess"))
             d->algo = CURLDIGESTALGO_MD5SESS;
-          else if(Curl_ascii_equal(content, "MD5"))
+          else if(Curl_raw_equal(content, "MD5"))
             d->algo = CURLDIGESTALGO_MD5;
           else
             return CURLDIGEST_BADALGO;
@@ -362,7 +362,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
     return CURLE_OUT_OF_MEMORY;
   }
 
-  if(d->qop && Curl_ascii_equal(d->qop, "auth-int")) {
+  if(d->qop && Curl_raw_equal(d->qop, "auth-int")) {
     /* We don't support auth-int at the moment. I can't see a easy way to get
        entity-body here */
     /* TODO: Append H(entity-body)*/
@@ -423,7 +423,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
                d->qop,
                request_digest);
 
-    if(Curl_ascii_equal(d->qop, "auth"))
+    if(Curl_raw_equal(d->qop, "auth"))
       d->nc++; /* The nc (from RFC) has to be a 8 hex digit number 0 padded
                   which tells to the server how many times you are using the
                   same nonce in the qop=auth mode. */
index 917269171f247649a44a09e168bfa2f1bf703382..ba52fa00417da95c9819c32dd732c3c0b925c631 100644 (file)
@@ -198,7 +198,7 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
   }
 
   /* Get the URL scheme ( either ldap or ldaps ) */
-  if(Curl_ascii_equal(conn->protostr, "LDAPS"))
+  if(Curl_raw_equal(conn->protostr, "LDAPS"))
     ldap_ssl = 1;
   infof(data, "LDAP local: trying to establish %s connection\n",
           ldap_ssl ? "encrypted" : "cleartext");
@@ -228,7 +228,7 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
       /* Novell SDK supports DER or BASE64 files. */
       int cert_type = LDAPSSL_CERT_FILETYPE_B64;
       if((data->set.str[STRING_CERT_TYPE]) &&
-         (Curl_ascii_equal(data->set.str[STRING_CERT_TYPE], "DER")))
+         (Curl_raw_equal(data->set.str[STRING_CERT_TYPE], "DER")))
         cert_type = LDAPSSL_CERT_FILETYPE_DER;
       if(!ldap_ca) {
         failf(data, "LDAP local: ERROR %s CA cert not set!",
@@ -269,7 +269,7 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
     if(data->set.ssl.verifypeer) {
       /* OpenLDAP SDK supports BASE64 files. */
       if((data->set.str[STRING_CERT_TYPE]) &&
-         (!Curl_ascii_equal(data->set.str[STRING_CERT_TYPE], "PEM"))) {
+         (!Curl_raw_equal(data->set.str[STRING_CERT_TYPE], "PEM"))) {
         failf(data, "LDAP local: ERROR OpenLDAP does only support PEM cert-type!");
         status = CURLE_SSL_CERTPROBLEM;
         goto quit;
index 2f049e9295bbd2bce6d4a49329e62ffa0ba42ff1..83ad0776181d6ef9bbc4ee6ff537e4c57f236f46 100644 (file)
@@ -155,7 +155,7 @@ int Curl_parsenetrc(const char *host,
 
         switch(state) {
         case NOTHING:
-          if(Curl_ascii_equal("machine", tok)) {
+          if(Curl_raw_equal("machine", tok)) {
             /* the next tok is the machine name, this is in itself the
                delimiter that starts the stuff entered for this machine,
                after this we need to search for 'login' and
@@ -164,7 +164,7 @@ int Curl_parsenetrc(const char *host,
           }
           break;
         case HOSTFOUND:
-          if(Curl_ascii_equal(host, tok)) {
+          if(Curl_raw_equal(host, tok)) {
             /* and yes, this is our host! */
             state=HOSTVALID;
 #ifdef _NETRC_DEBUG
@@ -180,7 +180,7 @@ int Curl_parsenetrc(const char *host,
           /* we are now parsing sub-keywords concerning "our" host */
           if(state_login) {
             if(specific_login) {
-              state_our_login = Curl_ascii_equal(login, tok);
+              state_our_login = Curl_raw_equal(login, tok);
             }
             else {
               strncpy(login, tok, LOGINSIZE-1);
@@ -199,11 +199,11 @@ int Curl_parsenetrc(const char *host,
             }
             state_password=0;
           }
-          else if(Curl_ascii_equal("login", tok))
+          else if(Curl_raw_equal("login", tok))
             state_login=1;
-          else if(Curl_ascii_equal("password", tok))
+          else if(Curl_raw_equal("password", tok))
             state_password=1;
-          else if(Curl_ascii_equal("machine", tok)) {
+          else if(Curl_raw_equal("machine", tok)) {
             /* ok, there's machine here go => */
             state = HOSTFOUND;
             state_our_login = FALSE;
index 409b0462d67f86959cd9911726d2174c1b7a502c..689326f48eea8132c309672d224bc08a0fabe026 100644 (file)
--- a/lib/nss.c
+++ b/lib/nss.c
@@ -201,7 +201,7 @@ static SECStatus set_ciphers(struct SessionHandle *data, PRFileDesc * model,
     found = PR_FALSE;
 
     for(i=0; i<NUM_OF_CIPHERS; i++) {
-      if(Curl_ascii_equal(cipher, cipherlist[i].name)) {
+      if(Curl_raw_equal(cipher, cipherlist[i].name)) {
         cipher_state[i] = PR_TRUE;
         found = PR_TRUE;
         break;
index 11dc55e64b2ce8df324edcc8bcd128b0e8d6f47d..ef2ee658bb7caba90eaf29275ecf46c1368912b4 100644 (file)
@@ -164,7 +164,7 @@ static int checkday(const char *check, size_t len)
   else
     what = &Curl_wkday[0];
   for(i=0; i<7; i++) {
-    if(Curl_ascii_equal(check, what[0])) {
+    if(Curl_raw_equal(check, what[0])) {
       found=TRUE;
       break;
     }
@@ -181,7 +181,7 @@ static int checkmonth(const char *check)
 
   what = &Curl_month[0];
   for(i=0; i<12; i++) {
-    if(Curl_ascii_equal(check, what[0])) {
+    if(Curl_raw_equal(check, what[0])) {
       found=TRUE;
       break;
     }
@@ -201,7 +201,7 @@ static int checktz(const char *check)
 
   what = tz;
   for(i=0; i< sizeof(tz)/sizeof(tz[0]); i++) {
-    if(Curl_ascii_equal(check, what->name)) {
+    if(Curl_raw_equal(check, what->name)) {
       found=TRUE;
       break;
     }
index 1c47508efe40dbe9b43dc94555a8229c226ccf04..3f2990cf8cbfeb68cc0927530a6df3cfc362b346 100644 (file)
@@ -284,13 +284,13 @@ static int do_file_type(const char *type)
 {
   if(!type || !type[0])
     return SSL_FILETYPE_PEM;
-  if(Curl_ascii_equal(type, "PEM"))
+  if(Curl_raw_equal(type, "PEM"))
     return SSL_FILETYPE_PEM;
-  if(Curl_ascii_equal(type, "DER"))
+  if(Curl_raw_equal(type, "DER"))
     return SSL_FILETYPE_ASN1;
-  if(Curl_ascii_equal(type, "ENG"))
+  if(Curl_raw_equal(type, "ENG"))
     return SSL_FILETYPE_ENGINE;
-  if(Curl_ascii_equal(type, "P12"))
+  if(Curl_raw_equal(type, "P12"))
     return SSL_FILETYPE_PKCS12;
   return -1;
 }
@@ -1010,7 +1010,7 @@ cert_hostcheck(const char *match_pattern, const char *hostname)
       !hostname || !*hostname) /* sanity check */
     return 0;
 
-  if(Curl_ascii_equal(hostname, match_pattern)) /* trivial case */
+  if(Curl_raw_equal(hostname, match_pattern)) /* trivial case */
     return 1;
 
   if(hostmatch(hostname,match_pattern) == HOST_MATCH)
index 53654c68a3fc50f0d3be3cdfb40cfe5c6f1d7277..5065b387157292e4d2746663bb00eac2d4e73e87 100644 (file)
@@ -78,7 +78,7 @@ int curl_strnequal(const char *first, const char *second, size_t max)
 
 /* Portable toupper (remember EBCDIC). Do not use tupper() because
    its behavior is altered by the current locale. */
-static bool my_toupper(unsigned char in)
+static unsigned char my_toupper(unsigned char in)
 {
   switch (in) {
   case 'a':
@@ -138,17 +138,18 @@ static bool my_toupper(unsigned char in)
 }
 
 /*
- * Curl_ascii_equal() is for doing "ascii" case insensitive strings. This is
- * meant to be locale independent and only compare strings we know are safe
- * for this.
- * See http://daniel.haxx.se/blog/2008/10/15/strcasecmp-in-turkish/ for some
- * further explanation to why this function is necessary.
+ * Curl_raw_equal() is for doing "raw" case insensitive strings. This is meant
+ * to be locale independent and only compare strings we know are safe for
+ * this.  See http://daniel.haxx.se/blog/2008/10/15/strcasecmp-in-turkish/ for
+ * some further explanation to why this function is necessary.
+ *
+ * The function is capable of comparing a-z case insensitively even for non-ascii.
  */
 
-int Curl_ascii_equal(const char *first, const char *second)
+int Curl_raw_equal(const char *first, const char *second)
 {
   while(*first && *second) {
-    if(! (my_toupper(*first) == my_toupper(*second)))
+    if(my_toupper(*first) != my_toupper(*second))
       /* get out of the loop as soon as they don't match */
       break;
     first++;
index d1bc86ef598011913b57ac81d6625de52ca43fea..778b23cd9ff6b9ecf5c64d26b11ccfcfb4049079 100644 (file)
 #define checkprefix(a,b)    strnequal(a,b,strlen(a))
 
 /*
- * Curl_ascii_equal() is for doing "ascii" case insensitive strings. This is
- * meant to be locale independent and only compare strings we know are safe
- * for this.
+ * Curl_raw_equal() is for doing "raw" case insensitive strings. This is meant
+ * to be locale independent and only compare strings we know are safe for
+ * this.
+ *
+ * The function is capable of comparing a-z case insensitively even for non-ascii.
  */
-int Curl_ascii_equal(const char *first, const char *second);
+int Curl_raw_equal(const char *first, const char *second);
 
 #ifndef HAVE_STRLCAT
 #define strlcat(x,y,z) Curl_strlcat(x,y,z)
index 6200445878ad3585c6e17c1fb74436f42b1acbff..7e7beb27c124b4e33d3592db175e4ec053942e28 100644 (file)
@@ -834,7 +834,7 @@ static CURLcode check_telnet_options(struct connectdata *conn)
               option_keyword, option_arg) == 2) {
 
       /* Terminal type */
-      if(Curl_ascii_equal(option_keyword, "TTYPE")) {
+      if(Curl_raw_equal(option_keyword, "TTYPE")) {
         strncpy(tn->subopt_ttype, option_arg, 31);
         tn->subopt_ttype[31] = 0; /* String termination */
         tn->us_preferred[CURL_TELOPT_TTYPE] = CURL_YES;
@@ -842,7 +842,7 @@ static CURLcode check_telnet_options(struct connectdata *conn)
       }
 
       /* Display variable */
-      if(Curl_ascii_equal(option_keyword, "XDISPLOC")) {
+      if(Curl_raw_equal(option_keyword, "XDISPLOC")) {
         strncpy(tn->subopt_xdisploc, option_arg, 127);
         tn->subopt_xdisploc[127] = 0; /* String termination */
         tn->us_preferred[CURL_TELOPT_XDISPLOC] = CURL_YES;
@@ -850,7 +850,7 @@ static CURLcode check_telnet_options(struct connectdata *conn)
       }
 
       /* Environment variable */
-      if(Curl_ascii_equal(option_keyword, "NEW_ENV")) {
+      if(Curl_raw_equal(option_keyword, "NEW_ENV")) {
         buf = strdup(option_arg);
         if(!buf)
           return CURLE_OUT_OF_MEMORY;
index 448133c6d34ebd9ef65bbf731d1e884b4835348c..0f007fa392e3a9c4449efbcf50e749fa2c60cdbc 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1216,17 +1216,17 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
     if(argptr == NULL)
       break;
 
-    if(Curl_ascii_equal(argptr, "ALL")) {
+    if(Curl_raw_equal(argptr, "ALL")) {
       /* clear all cookies */
       Curl_cookie_clearall(data->cookies);
       break;
     }
-    else if(Curl_ascii_equal(argptr, "SESS")) {
+    else if(Curl_raw_equal(argptr, "SESS")) {
       /* clear session cookies */
       Curl_cookie_clearsess(data->cookies);
       break;
     }
-    else if(Curl_ascii_equal(argptr, "FLUSH")) {
+    else if(Curl_raw_equal(argptr, "FLUSH")) {
       /* flush cookies to file */
       flush_cookies(data, 0);
       break;
@@ -2496,14 +2496,14 @@ ConnectionExists(struct SessionHandle *data,
     if(!needle->bits.httpproxy || needle->protocol&PROT_SSL ||
        (needle->bits.httpproxy && check->bits.httpproxy &&
         needle->bits.tunnel_proxy && check->bits.tunnel_proxy &&
-        Curl_ascii_equal(needle->proxy.name, check->proxy.name) &&
+        Curl_raw_equal(needle->proxy.name, check->proxy.name) &&
         (needle->port == check->port))) {
       /* The requested connection does not use a HTTP proxy or it uses SSL or
          it is a non-SSL protocol tunneled over the same http proxy name and
          port number */
 
-      if(Curl_ascii_equal(needle->protostr, check->protostr) &&
-         Curl_ascii_equal(needle->host.name, check->host.name) &&
+      if(Curl_raw_equal(needle->protostr, check->protostr) &&
+         Curl_raw_equal(needle->host.name, check->host.name) &&
          (needle->remote_port == check->remote_port) ) {
         if(needle->protocol & PROT_SSL) {
           /* This is SSL, verify that we're using the same
@@ -2542,7 +2542,7 @@ ConnectionExists(struct SessionHandle *data,
               is the checked one using the same host, port and type? */
       if(check->bits.proxy &&
          (needle->proxytype == check->proxytype) &&
-         Curl_ascii_equal(needle->proxy.name, check->proxy.name) &&
+         Curl_raw_equal(needle->proxy.name, check->proxy.name) &&
          needle->port == check->port) {
         /* This is the same proxy connection, use it! */
         match = TRUE;
@@ -3021,7 +3021,7 @@ static CURLcode ParseURLAndFillConnection(struct SessionHandle *data,
    ************************************************************/
   if((2 == sscanf(data->change.url, "%15[^:]:%[^\n]",
                   conn->protostr,
-                  path)) && Curl_ascii_equal(conn->protostr, "file")) {
+                  path)) && Curl_raw_equal(conn->protostr, "file")) {
     if(path[0] == '/' && path[1] == '/') {
       /* Allow omitted hostname (e.g. file:/<path>).  This is not strictly
        * speaking a valid file: URL by RFC 1738, but treating file:/<path> as
@@ -3256,7 +3256,7 @@ static CURLcode setup_connection_internals(struct SessionHandle *data,
   /* Scan protocol handler table. */
 
   for (pp = protocols; (p = *pp) != NULL; pp++)
-    if(Curl_ascii_equal(p->scheme, conn->protostr)) {
+    if(Curl_raw_equal(p->scheme, conn->protostr)) {
       /* Protocol found in table. Perform setup complement if some. */
       conn->handler = p;
 
@@ -3370,7 +3370,7 @@ static char *detect_proxy(struct connectdata *conn)
        * This can cause 'internal' http/ftp requests to be
        * arbitrarily redirected by any external attacker.
        */
-      if(!prox && !Curl_ascii_equal("http_proxy", proxy_env)) {
+      if(!prox && !Curl_raw_equal("http_proxy", proxy_env)) {
         /* There was no lowercase variable, try the uppercase version: */
         for(envp = proxy_env; *envp; envp++)
           *envp = (char)toupper((int)*envp);
@@ -3691,8 +3691,8 @@ static CURLcode parse_remote_port(struct SessionHandle *data,
     if(conn->bits.httpproxy) {
       /* we need to create new URL with the new port number */
       char *url;
-      bool isftp = (bool)(Curl_ascii_equal("ftp", conn->protostr) ||
-                          Curl_ascii_equal("ftps", conn->protostr));
+      bool isftp = (bool)(Curl_raw_equal("ftp", conn->protostr) ||
+                          Curl_raw_equal("ftps", conn->protostr));
 
       /*
        * This synthesized URL isn't always right--suffixes like ;type=A
index 6f1e9b47cf0956651a60b8209ab5c5dd8d88d919..949fc2ff843d370f0ef48b76bb6ca088f863c91c 100644 (file)
@@ -1501,11 +1501,11 @@ static ParameterError add2list(struct curl_slist **list,
 
 static int ftpfilemethod(struct Configurable *config, const char *str)
 {
-  if(curlx_ascii_equal("singlecwd", str))
+  if(curlx_raw_equal("singlecwd", str))
     return CURLFTPMETHOD_SINGLECWD;
-  if(curlx_ascii_equal("nocwd", str))
+  if(curlx_raw_equal("nocwd", str))
     return CURLFTPMETHOD_NOCWD;
-  if(curlx_ascii_equal("multicwd", str))
+  if(curlx_raw_equal("multicwd", str))
     return CURLFTPMETHOD_MULTICWD;
   warnf(config, "unrecognized ftp file method '%s', using default\n", str);
   return CURLFTPMETHOD_MULTICWD;
@@ -1513,9 +1513,9 @@ static int ftpfilemethod(struct Configurable *config, const char *str)
 
 static int ftpcccmethod(struct Configurable *config, const char *str)
 {
-  if(curlx_ascii_equal("passive", str))
+  if(curlx_raw_equal("passive", str))
     return CURLFTPSSL_CCC_PASSIVE;
-  if(curlx_ascii_equal("active", str))
+  if(curlx_raw_equal("active", str))
     return CURLFTPSSL_CCC_ACTIVE;
   warnf(config, "unrecognized ftp CCC method '%s', using default\n", str);
   return CURLFTPSSL_CCC_PASSIVE;
@@ -1765,7 +1765,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
       if(curlx_strnequal(aliases[j].lname, word, fnam)) {
         longopt = TRUE;
         numhits++;
-        if(curlx_ascii_equal(aliases[j].lname, word)) {
+        if(curlx_raw_equal(aliases[j].lname, word)) {
           parse = aliases[j].letter;
           hit = j;
           numhits = 1; /* a single unique hit */
@@ -2450,7 +2450,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
         break;
       case 'f': /* crypto engine */
         GetStr(&config->engine, nextarg);
-        if (config->engine && curlx_ascii_equal(config->engine,"list"))
+        if (config->engine && curlx_raw_equal(config->engine,"list"))
            config->list_engines = TRUE;
         break;
       case 'g': /* CA info PEM file */