Merged revisions 279504 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r279504 | mmichelson | 2010-07-26 11:04:09 -0500 (Mon, 26 Jul 2010) | 14 lines
  
  Allow for systems without locale support to be usable.
  
  A recent change to SIP URI comparison code added a locale-specific
  string comparison to the mix, and certain systems do not support
  such functions. This fix allows for those systems to still use
  Asterisk 1.8
  
  (closes issue #17697)
  Reported by: pprindeville
  Patches: 
        asterisk-trunk-bugid17697.patch uploaded by pprindeville (license 347)
  Tested by: mmichelson
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@279533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2010-07-26 16:44:25 +00:00
parent 1017e457ef
commit dd9428666d
4 changed files with 7597 additions and 30938 deletions

View File

@@ -27,7 +27,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "include/sip_utils.h"
#include "include/reqresp_parser.h"
#ifdef HAVE_XLOCALE_H
locale_t c_locale;
#endif
/*! \brief * parses a URI in its components.*/
int parse_uri_full(char *uri, const char *scheme, char **user, char **pass,
@@ -2006,7 +2008,11 @@ static int sip_uri_domain_cmp(const char *host1, const char *host2)
* i.e. ASCII.
*/
if (!addr1_parsed) {
#ifdef HAVE_XLOCALE_H
return strcasecmp_l(host1, host2, c_locale);
#else
return strcasecmp(host1, host2);
#endif
}
/* Both contain IP addresses */
@@ -2264,17 +2270,21 @@ void sip_request_parser_unregister_tests(void)
int sip_reqresp_parser_init(void)
{
#ifdef HAVE_XLOCALE_H
c_locale = newlocale(LC_CTYPE_MASK, "C", NULL);
if (!c_locale) {
return -1;
}
#endif
return 0;
}
void sip_reqresp_parser_exit(void)
{
#ifdef HAVE_XLOCALE_H
if (c_locale) {
freelocale(c_locale);
c_locale = NULL;
}
#endif
}