Commit 9d16b408 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Renamed Curl_ascii_equal to Curl_raw_equal and bugfixed the my_toupper function

used in strequal.c so now all test cases run fine for me again.
parent 545cafce
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -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 */

+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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;
}
+2 −2
Original line number Diff line number Diff line
@@ -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
+13 −13
Original line number Diff line number Diff line
@@ -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. */
Loading