From Jason Beverage, "I thought about the issue I was having with the CURL plugin automatically trying to download all filenames with URL's rather than passing the full URL to the plugin. It turns out the solution was pretty simple.

I've made a small change to Registry.cpp that puts the CURL logic AFTER the URL has been passed to the plugin rather than assuming all URL's need to be downloaded by the CURL plugin.  This way, plugins can have first crack at the URL's, and if they don't handle it the previous CURL behavior kicks in."
This commit is contained in:
Robert Osfield
2009-01-05 17:35:26 +00:00
parent 910927145e
commit 20cb9625ea

View File

@@ -1472,26 +1472,7 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
return archive->readObject(fileName,options.get());
}
}
// if filename contains archive
// then get archive name
// if archive name is not in the cache then do an openArchive on
// that archive name
// use that archive to read the file.
if (containsServerAddress(readFunctor._filename))
{
ReaderWriter* rw = getReaderWriterForExtension("curl");
if (rw)
{
return readFunctor.doRead(*rw);
}
else
{
return ReaderWriter::ReadResult("Warning: Could not find the .curl plugin to read from server.");
}
}
// record the errors reported by readerwriters.
typedef std::vector<ReaderWriter::ReadResult> Results;
Results results;
@@ -1556,6 +1537,21 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
else results.push_back(rr);
}
}
//If the filename contains a server address and wasn't loaded by any of the plugins, try to use the CURL plugin
//to download the file and use the stream reading functionality of the plugins to load the file
if (containsServerAddress(readFunctor._filename))
{
ReaderWriter* rw = getReaderWriterForExtension("curl");
if (rw)
{
return readFunctor.doRead(*rw);
}
else
{
return ReaderWriter::ReadResult("Warning: Could not find the .curl plugin to read from server.");
}
}
if (!results.empty())
{