diff options
| author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-06-07 17:17:19 +0000 |
|---|---|---|
| committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-06-07 17:17:19 +0000 |
| commit | 2a4c0f5cb2a12e880b53de7f1135f31e7fdf4e76 (patch) | |
| tree | 93c2ff01ff82ca996a10aecaed6cd847e8952eeb | |
| parent | 61f5dd623d3034c8004f8b0850f2b2458cc0a2d1 (diff) | |
| download | rockbox-2a4c0f5cb2a12e880b53de7f1135f31e7fdf4e76.zip rockbox-2a4c0f5cb2a12e880b53de7f1135f31e7fdf4e76.tar.gz rockbox-2a4c0f5cb2a12e880b53de7f1135f31e7fdf4e76.tar.bz2 rockbox-2a4c0f5cb2a12e880b53de7f1135f31e7fdf4e76.tar.xz | |
Only create cache file when no error occured. Ignore server errors when using download cache to make offline mode work again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17702 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | rbutil/rbutilqt/httpget.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/httpget.cpp b/rbutil/rbutilqt/httpget.cpp index 9c102f8..f4e2e04 100644 --- a/rbutil/rbutilqt/httpget.cpp +++ b/rbutil/rbutilqt/httpget.cpp @@ -291,7 +291,7 @@ void HttpGet::httpDone(bool error) if(!outputToBuffer) outputFile->close(); - if(m_usecache && !m_cached) { + if(m_usecache && !m_cached && !error) { qDebug() << "[HTTP] creating cache file" << m_cachefile; QFile c(m_cachefile); c.open(QIODevice::ReadWrite); @@ -305,6 +305,10 @@ void HttpGet::httpDone(bool error) c.close(); } + // if cached file found and cache enabled ignore http errors + if(m_usecache && m_cached && !http.hasPendingRequests()) { + error = false; + } // take care of concurring requests. If there is still one running, // don't emit done(). That request will call this slot again. if(http.currentId() == 0 && !http.hasPendingRequests()) |