From 1a86ed4e7ab0f8caa0f648feea385385fe128f08 Mon Sep 17 00:00:00 2001 From: "Konstantin S. Matveyev" Date: Mon, 26 Mar 2018 17:59:49 +0300 Subject: [PATCH] Write support with .curl pseudo extension added --- src/osgPlugins/curl/ReaderWriterCURL.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osgPlugins/curl/ReaderWriterCURL.cpp b/src/osgPlugins/curl/ReaderWriterCURL.cpp index 913662a08..1aa36166f 100644 --- a/src/osgPlugins/curl/ReaderWriterCURL.cpp +++ b/src/osgPlugins/curl/ReaderWriterCURL.cpp @@ -424,6 +424,12 @@ osgDB::ReaderWriter::WriteResult ReaderWriterCURL::writeFile(const osg::Object& // Serialize obj into an std::stringstream buffer which will be uploaded via HTTP post request. std::string fileName = EasyCurl::getFileNameFromURL(fullFileName); std::string ext = osgDB::getLowerCaseFileExtension(fileName); + if (ext == "curl") + { + fileName = osgDB::getNameLessExtension(fileName); + ext = osgDB::getLowerCaseFileExtension(fileName); + } + osgDB::ReaderWriter* writer = osgDB::Registry::instance()->getReaderWriterForExtension(ext); if (!writer) return WriteResult::FILE_NOT_HANDLED; osgDB::ReaderWriter::WriteResult result = writeFile(obj, writer, requestBuffer, options);