From 8037fed8d5391a8122d60b1f1c8768d623a0193e Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sat, 21 Mar 2009 18:01:59 +0000 Subject: 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 --- rbutil/rbutilqt/base/httpget.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'rbutil/rbutilqt/base') 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)); -- cgit v1.2.3