From Carlo Camporesi, "In attach there is a little bug fix to net plugin. The modify allow the plugin to accept url with port number in this way:

http://"address ":"portnumber"/
"
This commit is contained in:
Robert Osfield
2007-02-09 16:31:27 +00:00
parent 7a6d68e9d3
commit d6f3befdcf

View File

@@ -226,7 +226,6 @@ class NetReader : public osgDB::ReaderWriter
}
}
//if(proxy.empty()) //CARLO: proxy modf
// Env variables should override plug-in options.
{
char * env_proxyHost = getenv("OSG_PROXY_HOST"); //Checking proxy environment variables
@@ -267,6 +266,14 @@ class NetReader : public osgDB::ReaderWriter
fileName = inFileName;
}
//Find the Port Number specified in URL
index = hostname.find_last_of(":");
if( index != -1 )
{
port = atoi( hostname.substr( index + 1 ).c_str() );
hostname = hostname.substr( 0, index );
}
// Let's also strip the possible .net extension
if( osgDB::getFileExtension( fileName ) == "net" )
{
@@ -317,7 +324,15 @@ class NetReader : public osgDB::ReaderWriter
return ReadResult::FILE_NOT_FOUND;
}
requestAdd = std::string("http://") + hostname + "/" + fileName;
if(port != 80) //Default HTTP Port
{
std::ostringstream portstream;
portstream << port << std::flush;
requestAdd = std::string("http://") + hostname + std::string(":") + portstream.str() + std::string("/") + fileName;
}
else
requestAdd = std::string("http://") + hostname + std::string("/") + fileName;
}
else
{