MCPcopy Create free account
hub / github.com/clangen/musikcube / ResetFileHandles

Method ResetFileHandles

src/plugins/httpdatastream/HttpDataStream.cpp:384–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384void HttpDataStream::ResetFileHandles() {
385 if (this->writeFile) {
386 fclose(this->writeFile);
387 this->writeFile = nullptr;
388 }
389
390 if (this->reader) {
391 this->reader->Interrupt();
392 this->reader.reset();
393 }
394
395 auto const id = cacheId(httpUri);
396 diskCache.Delete(id, this->instanceId);
397 this->writeFile = diskCache.Open(id, this->instanceId, "wb");
398 if (this->writeFile) {
399 this->reader = std::make_shared<FileReadStream>(this->httpUri, this->instanceId);
400 }
401}
402
403void HttpDataStream::ThreadProc() {
404 if (this->curlEasy) {

Callers 2

OpenMethod · 0.95
ThreadProcMethod · 0.95

Calls 5

cacheIdFunction · 0.85
InterruptMethod · 0.45
resetMethod · 0.45
DeleteMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected