summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/rbutilqt/httpget.cpp6
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())