CHD over http wasn't actually working, disable again until it can be fixed

This commit is contained in:
Henrik Rydgård 2023-12-29 12:17:10 +01:00
parent 1e6584148d
commit a416d94e38
8 changed files with 24 additions and 10 deletions

View file

@ -302,7 +302,9 @@ void LogManager::RemoveListener(LogListener *listener) {
}
FileLogListener::FileLogListener(const char *filename) {
fp_ = File::OpenCFile(Path(std::string(filename)), "at");
if (strlen(filename) > 0) {
fp_ = File::OpenCFile(Path(std::string(filename)), "at");
}
SetEnabled(fp_ != nullptr);
}

View file

@ -422,7 +422,7 @@ bool OutputSink::Empty() const {
return valid_ == 0;
}
int OutputSink::BytesRemaining() const {
size_t OutputSink::BytesRemaining() const {
return valid_;
}

View file

@ -55,7 +55,7 @@ public:
void Discard();
bool Empty() const;
int BytesRemaining() const;
size_t BytesRemaining() const;
private:
void Drain();

View file

@ -692,7 +692,7 @@ bool DiskCachingFileLoaderCache::LockCacheFile(bool lockStatus) {
// TODO: Also use flock where supported?
if (lockStatus) {
if ((flags_ & FLAG_LOCKED) != 0) {
ERROR_LOG(LOADER, "Could not lock disk cache file for %s", origPath_.c_str());
ERROR_LOG(LOADER, "Could not lock disk cache file for %s (already locked)", origPath_.c_str());
return false;
}
flags_ |= FLAG_LOCKED;

View file

@ -621,7 +621,7 @@ CHDFileBlockDevice::CHDFileBlockDevice(FileLoader *fileLoader)
CHDFileBlockDevice::~CHDFileBlockDevice()
{
if (numBlocks > 0) {
if (impl_->chd) {
chd_close(impl_->chd);
delete[] readBuffer;
}
@ -629,6 +629,10 @@ CHDFileBlockDevice::~CHDFileBlockDevice()
bool CHDFileBlockDevice::ReadBlock(int blockNumber, u8 *outPtr, bool uncached)
{
if (!impl_->chd) {
ERROR_LOG(LOADER, "ReadBlock: CHD not open. %s", fileLoader_->GetPath().c_str());
return false;
}
if ((u32)blockNumber >= numBlocks) {
memset(outPtr, 0, GetBlockSize());
return false;

View file

@ -147,10 +147,10 @@ public:
private:
std::unique_ptr<CHDImpl> impl_;
u8 *readBuffer;
u32 currentHunk;
u32 blocksPerHunk;
u32 numBlocks;
u8 *readBuffer = nullptr;
u32 currentHunk = 0;
u32 blocksPerHunk = 0;
u32 numBlocks = 0;
};
BlockDevice *constructBlockDevice(FileLoader *fileLoader);

View file

@ -190,6 +190,12 @@ static bool LoadSymbolsIfSupported() {
if (!g_symbolMap)
return false;
if (PSP_CoreParameter().fileToStart.Type() == PathType::HTTP) {
// We don't support loading symbols over HTTP.
g_symbolMap->Clear();
return true;
}
bool result1 = g_symbolMap->LoadSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".ppmap"));
// Load the old-style map file.
if (!result1)

View file

@ -113,7 +113,9 @@ static bool RegisterServer(int port) {
bool RemoteISOFileSupported(const std::string &filename) {
// Disc-like files.
if (endsWithNoCase(filename, ".cso") || endsWithNoCase(filename, ".iso") || endsWithNoCase(filename, ".chd")) {
// NOTE: chd is temporarily disabled until we can make it use the FileLoader instead of
// trying to re-open the file, since otherwise won't work over HTTP.
if (endsWithNoCase(filename, ".cso") || endsWithNoCase(filename, ".iso")) {
return true;
}
// May work - but won't have supporting files.