aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-06-04 19:02:23 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-06-04 19:02:23 +0000
commitcbdc0b1534282a1a8aae25a90b5f918ca8a9db12 (patch)
treeca662352ac1555cdd9f93842958070944f7ff2bd /src
parentcaa17db85e2401f1ed9e4ddcc587ba8d511f79fb (diff)
downloadmpd-cbdc0b1534282a1a8aae25a90b5f918ca8a9db12.tar.gz
mpd-cbdc0b1534282a1a8aae25a90b5f918ca8a9db12.tar.xz
mpd-cbdc0b1534282a1a8aae25a90b5f918ca8a9db12.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/inputStream_http.c12
1 files changed, 6 insertions, 6 deletions
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)