Skip to content

Commit

Permalink
Merge pull request xbmc#2307 from ulion/fix_redirected_shoutcast_tick…
Browse files Browse the repository at this point in the history
…et_12729

Fix redirected shoutcast ticket 12729
  • Loading branch information
ulion committed Feb 27, 2013
2 parents a0e6bac + 452452b commit 593e07d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xbmc/filesystem/CurlFile.cpp
Expand Up @@ -575,6 +575,13 @@ void CCurlFile::SetCommonOptions(CReadState* state)

// Set the lowspeed time very low as it seems Curl takes much longer to detect a lowspeed condition
g_curlInterface.easy_setopt(h, CURLOPT_LOW_SPEED_TIME, m_lowspeedtime);

if (m_skipshout)
// For shoutcast file, content-length should not be set, and in libcurl there is a bug, if the
// cast file was 302 redirected then getinfo of CURLINFO_CONTENT_LENGTH_DOWNLOAD will return
// the 302 response's body length, which cause the next read request failed, so we ignore
// content-length for shoutcast file to workaround this.
g_curlInterface.easy_setopt(h, CURLOPT_IGNORE_CONTENT_LENGTH, 1);
}

void CCurlFile::SetRequestHeaders(CReadState* state)
Expand Down
1 change: 1 addition & 0 deletions xbmc/filesystem/ShoutcastFile.cpp
Expand Up @@ -134,6 +134,7 @@ void CShoutcastFile::Close()
{
StopThread();
delete[] m_buffer;
m_buffer = NULL;
m_file.Close();
}

Expand Down

0 comments on commit 593e07d

Please sign in to comment.