Changeset 9443

Show
Ignore:
Timestamp:
01/05/09 18:35:26 (6 years ago)
Author:
robert
Message:

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."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgDB/Registry.cpp

    r9124 r9443  
    14731473        } 
    14741474    } 
    1475  
    1476     // if filename contains archive 
    1477     // then get archive name 
    1478     // if archive name is not in the cache then do an openArchive on 
    1479     // that archive name 
    1480     // use that archive to read the file. 
    1481  
    1482     if (containsServerAddress(readFunctor._filename)) 
    1483     { 
    1484         ReaderWriter* rw = getReaderWriterForExtension("curl"); 
    1485         if (rw) 
    1486         { 
    1487             return readFunctor.doRead(*rw); 
    1488         } 
    1489         else 
    1490         { 
    1491             return  ReaderWriter::ReadResult("Warning: Could not find the .curl plugin to read from server."); 
    1492         } 
    1493     } 
    1494      
     1475  
    14951476    // record the errors reported by readerwriters. 
    14961477    typedef std::vector<ReaderWriter::ReadResult> Results; 
     
    15571538        } 
    15581539    } 
     1540 
     1541    //If the filename contains a server address and wasn't loaded by any of the plugins, try to use the CURL plugin 
     1542    //to download the file and use the stream reading functionality of the plugins to load the file 
     1543    if (containsServerAddress(readFunctor._filename)) 
     1544    { 
     1545        ReaderWriter* rw = getReaderWriterForExtension("curl"); 
     1546        if (rw) 
     1547        { 
     1548            return readFunctor.doRead(*rw); 
     1549        } 
     1550        else 
     1551        { 
     1552            return  ReaderWriter::ReadResult("Warning: Could not find the .curl plugin to read from server."); 
     1553        } 
     1554    } 
    15591555     
    15601556    if (!results.empty())