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
This commit is contained in:
Dominik Riebeling 2009-03-21 18:01:59 +00:00
parent a5394727a0
commit 8037fed8d5

View file

@ -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));