From Jason Beverage, "I realized today that there is an issue with the Registry changes I submitted to allow plugins to have the first go at URLs.

The code works fine as is if the format plugin is not already loaded in memory.

If a plugin is already in memory, say the PNG plugin for example, then a call to readImageFile("http://server.com/image.png") will return FILE_NOT_FOUND because osgDB::findDataFile will not be able to locate the file.  So the Registry::read method is returning before the CURL plugin is given a chance to download the file.

I've made a few changes to the Registry to not return FILE_NOT_FOUND if the filename contains a URL that fix the issue."
This commit is contained in:
Robert Osfield
2009-01-21 17:10:51 +00:00
parent 39fc490a64
commit e17535813f

View File

@@ -1517,12 +1517,16 @@ ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
}
}
for(ritr=results.begin(); ritr!=results.end(); ++ritr)
//If the filename is a URL, don't return FILE_NOT_FOUND until the CURL plugin is given a chance
if (!osgDB::containsServerAddress(readFunctor._filename))
{
if (ritr->status()==ReaderWriter::ReadResult::FILE_NOT_FOUND)
for(ritr=results.begin(); ritr!=results.end(); ++ritr)
{
// osg::notify(osg::NOTICE)<<"Warning: could not find file \""<<readFunctor._filename<<"\""<<std::endl;
return *ritr;
if (ritr->status()==ReaderWriter::ReadResult::FILE_NOT_FOUND)
{
//osg::notify(osg::NOTICE)<<"Warning: could not find file \""<<readFunctor._filename<<"\""<<std::endl;
return *ritr;
}
}
}
}