Skip to content

Commit

Permalink
Fix for bug 8192440, enabled parsing of ICY headers
Browse files Browse the repository at this point in the history
Let the http stack also parse ICY status headers.

Change-Id: I2ab636bbb54bfc91a40168efcfc7025cb03bbb2e
  • Loading branch information
kristianmonsen committed Mar 14, 2013
1 parent 7367b09 commit 872788f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/http/http_util.cc
Expand Up @@ -439,12 +439,19 @@ std::string HttpUtil::Quote(const std::string& str) {
int HttpUtil::LocateStartOfStatusLine(const char* buf, int buf_len) {
const int slop = 4;
const int http_len = 4;
#ifdef ANDROID
const int icy_len = 3;
#endif

if (buf_len >= http_len) {
int i_max = std::min(buf_len - http_len, slop);
for (int i = 0; i <= i_max; ++i) {
if (LowerCaseEqualsASCII(buf + i, buf + i + http_len, "http"))
return i;
#ifdef ANDROID
if (LowerCaseEqualsASCII(buf + i, buf + i + icy_len, "icy"))
return i;
#endif
}
}
return -1; // Not found
Expand Down

0 comments on commit 872788f

Please sign in to comment.