mirror of
https://github.com/clangen/musikcube.git
synced 2024-12-29 00:17:49 +00:00
Fixed a couple long-dormant bugs in HttpDataStream
This commit is contained in:
parent
0d11e3da12
commit
e966b36b24
@ -161,7 +161,7 @@ class FileReadStream {
|
||||
this->underflow.wait(lock);
|
||||
}
|
||||
|
||||
if (this->interrupted && this->Eof()) {
|
||||
if (this->interrupted || this->Eof()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -377,13 +377,14 @@ void HttpDataStream::ThreadProc() {
|
||||
|
||||
bool HttpDataStream::Close() {
|
||||
this->Interrupt();
|
||||
this->reader.reset();
|
||||
|
||||
if (this->downloadThread) {
|
||||
downloadThread->join();
|
||||
this->downloadThread.reset();
|
||||
}
|
||||
|
||||
this->reader.reset();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -435,7 +436,6 @@ size_t HttpDataStream::CurlWriteCallback(char *ptr, size_t size, size_t nmemb, v
|
||||
size_t result = fwrite(ptr, size, nmemb, stream->writeFile);
|
||||
stream->written += result;
|
||||
|
||||
|
||||
if (stream->written >= NOTIFY_INTERVAL_BYTES) {
|
||||
fflush(stream->writeFile);
|
||||
stream->reader->Add(stream->written);
|
||||
|
Loading…
Reference in New Issue
Block a user