diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-03-21 18:01:59 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-03-21 18:01:59 +0000 |
commit | 8037fed8d5391a8122d60b1f1c8768d623a0193e (patch) | |
tree | f64df6fa6ceb9e5a80b8e0021cb49e8bf7676ffa /rbutil/rbutilqt/base | |
parent | a5394727a041288d12c08a416c81347406733349 (diff) |
HttpGet: if downloaded data should be written to output buffer make sure the buffer empty. This prevents old data available to the caller if a HttpGet object is reused and the new request fails.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20432 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r-- | rbutil/rbutilqt/base/httpget.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/base/httpget.cpp b/rbutil/rbutilqt/base/httpget.cpp index b226f4892a..bd15de41a9 100644 --- a/rbutil/rbutilqt/base/httpget.cpp +++ b/rbutil/rbutilqt/base/httpget.cpp @@ -184,6 +184,11 @@ bool HttpGet::getFile(const QUrl &url) return false; } } + else { + // output to buffer. Make sure buffer is empty so no old data gets + // returned in case the object is reused. + dataBuffer.clear(); + } qDebug() << "[HTTP] downloading" << url.toEncoded(); // create request http.setHost(url.host(), url.port(80)); |