summaryrefslogtreecommitdiff
path: root/channels/sip
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2010-07-26 16:44:25 +0000
committerMark Michelson <mmichelson@digium.com>2010-07-26 16:44:25 +0000
commitdd9428666d93c1ec42c5ea2b86552f64b41343c5 (patch)
treeff2c9998747b51d0a525a9ab575c9a1f9f578c29 /channels/sip
parent1017e457ef8571f2da14a18811a34d1edf3521ae (diff)
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
Diffstat (limited to 'channels/sip')
-rw-r--r--channels/sip/reqresp_parser.c10
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
}