pdns
pdns copied to clipboard
Consider replacing strcasecmp calls
- Program: Authoritative, Recursor, dnsdist
Short description
Otto raised the fact that strcasecmp() is locale dependent and that it could lead to performance issues, in the comments of #11624. We should investigate how we can replace it to avoid any surprises.
cf. https://daniel.haxx.se/blog/2022/05/19/case-insensitive-string-comparisons-in-c/
Right, so it looks like strcasecmp can be slower with some locales because it is heavily optimized in some cases? Then we likely need to make sure that our version is not just slow in all cases ;)
Or use OpenBSD :-)
On OpenBSD, these functions always use the C locale and ignore the global
locale, the thread-specific locale, and the locale argument.