Skip to content

Commit

Permalink
Merge pull request xbmc#6528 from ksooo/rssreader-improve-network-pro…
Browse files Browse the repository at this point in the history
…blem-handling

[rss] CRssReader::Process: Sleep 5 secs before retrying CCurlFile::Get().
  • Loading branch information
FernetMenta committed Mar 2, 2015
2 parents 613593f + 6197aa4 commit eaf9cbe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions xbmc/utils/RssReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ void CRssReader::Process()
{
if (timeout.IsTimePast())
{
CLog::Log(LOGERROR, "Timeout whilst retrieving %s", strUrl.c_str());
http.Cancel();
CLog::Log(LOGERROR, "Timeout while retrieving rss feed: %s", strUrl.c_str());
break;
}
nRetries--;
Expand All @@ -176,12 +175,18 @@ void CRssReader::Process()
}
}
else
{
if (http.Get(strUrl, strXML))
{
fileCharset = http.GetServerReportedCharset();
CLog::Log(LOGDEBUG, "Got rss feed: %s", strUrl.c_str());
break;
}
else if (nRetries > 0)
Sleep(5000); // Network problems? Retry, but not immediately.
else
CLog::Log(LOGERROR, "Unable to obtain rss feed: %s", strUrl.c_str());
}
}
http.Cancel();
}
Expand Down

0 comments on commit eaf9cbe

Please sign in to comment.