diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-07-26 16:04:09 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-07-26 16:04:09 +0000 |
commit | 0b32feeea0cfeb4a56363ff11456ac1bca8f79c1 (patch) | |
tree | 2bbf1dd50ef6c6d29cd97b4287084b6cee21e3da /channels | |
parent | 49f9e730751ae45e3ff5d28e4a13712c306aaae9 (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.8@279504 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/sip/reqresp_parser.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/channels/sip/reqresp_parser.c b/channels/sip/reqresp_parser.c index 460fca16d..ac9aeaba9 100644 --- a/channels/sip/reqresp_parser.c +++ b/channels/sip/reqresp_parser.c @@ -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 } |