Skip to content
This repository
Browse code

Merge pull request #2307 from ulion/fix_redirected_shoutcast_ticket_1…

…2729

Fix redirected shoutcast ticket 12729
  • Loading branch information...
commit 593e07dcd8b36d4d0f4cfddccebfe00ae98af8fd 2 parents a0e6bac + 452452b
ulion authored February 27, 2013
7  xbmc/filesystem/CurlFile.cpp
@@ -575,6 +575,13 @@ void CCurlFile::SetCommonOptions(CReadState* state)
575 575
 
576 576
   // Set the lowspeed time very low as it seems Curl takes much longer to detect a lowspeed condition
577 577
   g_curlInterface.easy_setopt(h, CURLOPT_LOW_SPEED_TIME, m_lowspeedtime);
  578
+
  579
+  if (m_skipshout)
  580
+    // For shoutcast file, content-length should not be set, and in libcurl there is a bug, if the
  581
+    // cast file was 302 redirected then getinfo of CURLINFO_CONTENT_LENGTH_DOWNLOAD will return
  582
+    // the 302 response's body length, which cause the next read request failed, so we ignore
  583
+    // content-length for shoutcast file to workaround this.
  584
+    g_curlInterface.easy_setopt(h, CURLOPT_IGNORE_CONTENT_LENGTH, 1);
578 585
 }
579 586
 
580 587
 void CCurlFile::SetRequestHeaders(CReadState* state)
1  xbmc/filesystem/ShoutcastFile.cpp
@@ -134,6 +134,7 @@ void CShoutcastFile::Close()
134 134
 {
135 135
   StopThread();
136 136
   delete[] m_buffer;
  137
+  m_buffer = NULL;
137 138
   m_file.Close();
138 139
 }
139 140
 

0 notes on commit 593e07d

Please sign in to comment.
Something went wrong with that request. Please try again.