aboutsummaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-20 23:09:51 +0200
committerMax Kellermann <max@duempel.org>2013-10-20 23:09:51 +0200
commit0e4d2e7277bc2adf18dd1e719ec4ce684f86d72b (patch)
tree181aa272821ace382565b3c3465949101b98e253 /src/input
parent2bbff77e489ae72a332b18b122844bd761d75764 (diff)
downloadmpd-0e4d2e7277bc2adf18dd1e719ec4ce684f86d72b.tar.gz
mpd-0e4d2e7277bc2adf18dd1e719ec4ce684f86d72b.tar.xz
mpd-0e4d2e7277bc2adf18dd1e719ec4ce684f86d72b.zip
Util/ASCII: add function StringEqualsCaseASCII()
Replaces GLib's g_ascii_strcasecmp().
Diffstat (limited to 'src/input')
-rw-r--r--src/input/CurlInputPlugin.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/input/CurlInputPlugin.cxx b/src/input/CurlInputPlugin.cxx
index da1dec5bd..5a754b78d 100644
--- a/src/input/CurlInputPlugin.cxx
+++ b/src/input/CurlInputPlugin.cxx
@@ -29,6 +29,7 @@
#include "event/MultiSocketMonitor.hxx"
#include "event/Call.hxx"
#include "IOThread.hxx"
+#include "util/ASCII.hxx"
#include "util/CharUtil.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
@@ -840,11 +841,11 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
while (end > value && IsWhitespaceOrNull(end[-1]))
--end;
- if (g_ascii_strcasecmp(name, "accept-ranges") == 0) {
+ if (StringEqualsCaseASCII(name, "accept-ranges")) {
/* a stream with icy-metadata is not seekable */
if (!c->icy.IsDefined())
c->base.seekable = true;
- } else if (g_ascii_strcasecmp(name, "content-length") == 0) {
+ } else if (StringEqualsCaseASCII(name, "content-length")) {
char buffer[64];
if ((size_t)(end - header) >= sizeof(buffer))
@@ -854,18 +855,18 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
buffer[end - value] = 0;
c->base.size = c->base.offset + g_ascii_strtoull(buffer, nullptr, 10);
- } else if (g_ascii_strcasecmp(name, "content-type") == 0) {
+ } else if (StringEqualsCaseASCII(name, "content-type")) {
c->base.mime.assign(value, end);
- } else if (g_ascii_strcasecmp(name, "icy-name") == 0 ||
- g_ascii_strcasecmp(name, "ice-name") == 0 ||
- g_ascii_strcasecmp(name, "x-audiocast-name") == 0) {
+ } else if (StringEqualsCaseASCII(name, "icy-name") ||
+ StringEqualsCaseASCII(name, "ice-name") ||
+ StringEqualsCaseASCII(name, "x-audiocast-name")) {
c->meta_name.assign(value, end);
delete c->tag;
c->tag = new Tag();
c->tag->AddItem(TAG_NAME, c->meta_name.c_str());
- } else if (g_ascii_strcasecmp(name, "icy-metaint") == 0) {
+ } else if (StringEqualsCaseASCII(name, "icy-metaint")) {
char buffer[64];
size_t icy_metaint;