From cbdc0b1534282a1a8aae25a90b5f918ca8a9db12 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Mon, 4 Jun 2007 19:02:23 +0000 Subject: Use strncasecmp instead of strncmp when comparing HTTP headers. It seems some versions of shoutcast send "content-type" in all lowercase, and I don't trust other servers to get the case right for the rest of the headers we look for. git-svn-id: https://svn.musicpd.org/mpd/trunk@6482 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputStream_http.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/inputStream_http.c b/src/inputStream_http.c index 1da09c821..8acc106d8 100644 --- a/src/inputStream_http.c +++ b/src/inputStream_http.c @@ -610,13 +610,13 @@ static int getHTTPHello(InputStream * inStream) cur = strstr(data->buffer, "\r\n"); while (cur && cur != needle) { - if (0 == strncmp(cur, "\r\nContent-Length: ", 18)) { + if (0 == strncasecmp(cur, "\r\nContent-Length: ", 18)) { if (!inStream->size) inStream->size = atol(cur + 18); - } else if (0 == strncmp(cur, "\r\nicy-metaint:", 14)) { + } else if (0 == strncasecmp(cur, "\r\nicy-metaint:", 14)) { data->icyMetaint = atoi(cur + 14); - } else if (0 == strncmp(cur, "\r\nicy-name:", 11) || - 0 == strncmp(cur, "\r\nice-name:", 11)) { + } else if (0 == strncasecmp(cur, "\r\nicy-name:", 11) || + 0 == strncasecmp(cur, "\r\nice-name:", 11)) { int incr = 11; char *temp = strstr(cur + incr, "\r\n"); if (!temp) @@ -630,7 +630,7 @@ static int getHTTPHello(InputStream * inStream) *temp = '\r'; DEBUG("inputStream_http: metaName: %s\n", inStream->metaName); - } else if (0 == strncmp(cur, "\r\nx-audiocast-name:", 19)) { + } else if (0 == strncasecmp(cur, "\r\nx-audiocast-name:", 19)) { int incr = 19; char *temp = strstr(cur + incr, "\r\n"); if (!temp) @@ -644,7 +644,7 @@ static int getHTTPHello(InputStream * inStream) *temp = '\r'; DEBUG("inputStream_http: metaName: %s\n", inStream->metaName); - } else if (0 == strncmp(cur, "\r\nContent-Type:", 15)) { + } else if (0 == strncasecmp(cur, "\r\nContent-Type:", 15)) { int incr = 15; char *temp = strstr(cur + incr, "\r\n"); if (!temp) -- cgit v1.2.3