mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
BACKENDS: NETWORKING: Fix local file downloading when stream is reused
This commit is contained in:
parent
4e32936376
commit
1507559a66
@ -62,6 +62,8 @@ void SessionRequest::openLocalFile(Common::String localFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
debug(5, "SessionRequest: opened localfile %s", localFile.c_str());
|
||||
|
||||
_binary = true; // Enforce binary
|
||||
}
|
||||
|
||||
@ -105,6 +107,11 @@ void SessionRequest::finishSuccess() {
|
||||
_complete = true;
|
||||
_success = true;
|
||||
|
||||
if (_localFile) {
|
||||
_localFile->close();
|
||||
_localFile = nullptr;
|
||||
}
|
||||
|
||||
if (_callback) { // If localfile is present, contentStream is empty, so it is fine
|
||||
_response.buffer = _contentsStream.getData();
|
||||
_response.len = _contentsStream.size();
|
||||
@ -112,11 +119,6 @@ void SessionRequest::finishSuccess() {
|
||||
|
||||
(*_callback)(DataResponse(this, &_response));
|
||||
}
|
||||
|
||||
if (_localFile) {
|
||||
_localFile->close();
|
||||
_localFile = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void SessionRequest::start() {
|
||||
|
Loading…
Reference in New Issue
Block a user