diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2009-09-19 21:00:07 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2009-09-19 21:00:07 +0000 |
commit | d0b048e82d4dbb41302201f7b4b9c96d499312d9 (patch) | |
tree | 3079d4c6c993433cfe6e9419823f97948ac50e1b /rbutil/rbutilqt/base/httpget.cpp | |
parent | 6a9a196eaeccddec7330513bda2fe779c489accb (diff) | |
download | rockbox-d0b048e82d4dbb41302201f7b4b9c96d499312d9.tar.gz rockbox-d0b048e82d4dbb41302201f7b4b9c96d499312d9.zip |
rbutil: dont output a error if rbutil follows a http redirect.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22739 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base/httpget.cpp')
-rw-r--r-- | rbutil/rbutilqt/base/httpget.cpp | 10 |
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) | |||
390 | // if there is a network error abort all scheduled requests for | 390 | // if there is a network error abort all scheduled requests for |
391 | // this download | 391 | // this download |
392 | m_response = resp.statusCode(); | 392 | m_response = resp.statusCode(); |
393 | if(m_response != 200) { | 393 | |
394 | // abort old request first. | ||
395 | http.abort(); | ||
396 | } | ||
397 | // 301 -- moved permanently | 394 | // 301 -- moved permanently |
398 | // 302 -- found | 395 | // 302 -- found |
399 | // 303 -- see other | 396 | // 303 -- see other |
400 | // 307 -- moved temporarily | 397 | // 307 -- moved temporarily |
401 | // in all cases, header: location has the correct address so we can follow. | 398 | // in all cases, header: location has the correct address so we can follow. |
402 | if(m_response == 301 || m_response == 302 || m_response == 303 || m_response == 307) { | 399 | if(m_response == 301 || m_response == 302 || m_response == 303 || m_response == 307) { |
400 | //abort without sending any signals | ||
401 | http.blockSignals(true); | ||
402 | http.abort(); | ||
403 | http.blockSignals(false); | ||
403 | // start new request with new url | 404 | // start new request with new url |
404 | qDebug() << "[HTTP] response =" << m_response << "- following"; | 405 | qDebug() << "[HTTP] response =" << m_response << "- following"; |
405 | getFile(resp.value("location") + m_query); | 406 | getFile(resp.value("location") + m_query); |
406 | } | 407 | } |
407 | else if(m_response != 200) { | 408 | else if(m_response != 200) { |
408 | // all other errors are fatal. | 409 | // all other errors are fatal. |
410 | http.abort(); | ||
409 | qDebug() << "[HTTP] Response error:" << m_response << resp.reasonPhrase(); | 411 | qDebug() << "[HTTP] Response error:" << m_response << resp.reasonPhrase(); |
410 | } | 412 | } |
411 | 413 | ||