summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/httpget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base/httpget.cpp')
-rw-r--r--rbutil/rbutilqt/base/httpget.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/httpget.cpp b/rbutil/rbutilqt/base/httpget.cpp
index dab93d1b19..e808a6381d 100644
--- a/rbutil/rbutilqt/base/httpget.cpp
+++ b/rbutil/rbutilqt/base/httpget.cpp
@@ -390,22 +390,24 @@ void HttpGet::httpResponseHeader(const QHttpResponseHeader &resp)
// if there is a network error abort all scheduled requests for
// this download
m_response = resp.statusCode();
- if(m_response != 200) {
- // abort old request first.
- http.abort();
- }
+
// 301 -- moved permanently
// 302 -- found
// 303 -- see other
// 307 -- moved temporarily
// in all cases, header: location has the correct address so we can follow.
if(m_response == 301 || m_response == 302 || m_response == 303 || m_response == 307) {
+ //abort without sending any signals
+ http.blockSignals(true);
+ http.abort();
+ http.blockSignals(false);
// start new request with new url
qDebug() << "[HTTP] response =" << m_response << "- following";
getFile(resp.value("location") + m_query);
}
else if(m_response != 200) {
// all other errors are fatal.
+ http.abort();
qDebug() << "[HTTP] Response error:" << m_response << resp.reasonPhrase();
}