socks_proxy_info_matches(const struct proxy_info *data,
                         const struct proxy_info *needle)
{
  if(!proxy_info_matches(data, needle))
    return FALSE;

  /* the user information is case-sensitive
     or at least it is not defined as case-insensitive
     see https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1 */
  if(!data->user != !needle->user)
    return FALSE;
  /* curl_strequal does a case insentive comparison, so do not use it here! */
  if(data->user &&
     needle->user &&
     strcmp(data->user, needle->user) != 0)
    return FALSE;
  if(!data->passwd != !needle->passwd)
    return FALSE;
  /* curl_strequal does a case insentive comparison, so do not use it here! */
  if(data->passwd &&
     needle->passwd &&
     strcmp(data->passwd, needle->passwd) != 0)
    return FALSE;
  return TRUE;
}
socks_proxy_info_matches(const struct proxy_info *data,
                         const struct proxy_info *needle)
{
  if(!proxy_info_matches(data, needle))
    return FALSE;

   
  if(!data->user != !needle->user)
    return FALSE;
   
  if(data->user &&
     needle->user &&
     strcmp(data->user, needle->user) != 0)
    return FALSE;
  if(!data->passwd != !needle->passwd)
    return FALSE;
   
  if(data->passwd &&
     needle->passwd &&
     strcmp(data->passwd, needle->passwd) != 0)
    return FALSE;
  return TRUE;
}