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:
parent
a5394727a0
commit
8037fed8d5
1 changed files with 5 additions and 0 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue