[Saga-devel] saga SVN commit 3317: /trunk/adaptors/default/file/

amerzky at cct.lsu.edu amerzky at cct.lsu.edu
Sat Jan 17 06:09:36 CST 2009


User: amerzky
Date: 2009/01/17 06:09 AM

Modified:
 /trunk/adaptors/default/file/
  default_dir.cpp, default_file.cpp

Log:
 use new localhost check

File Changes:

Directory: /trunk/adaptors/default/file/
========================================

File [modified]: default_dir.cpp
Delta lines: +1 -1
===================================================================
--- trunk/adaptors/default/file/default_dir.cpp	2009-01-17 12:05:20 UTC (rev 3316)
+++ trunk/adaptors/default/file/default_dir.cpp	2009-01-17 12:09:26 UTC (rev 3317)
@@ -46,7 +46,7 @@
     fs::path path (saga::url::unescape(dir_url.get_path()), fs::native);
 
     std::string host(dir_url.get_host());
-    if (!host.empty() && host != "localhost" && !boost::iequals(host, ::detail::get_hostname()))
+    if ( ! saga::adaptors::utils::url_is_local (dir_url) )
     {
         SAGA_OSSTREAM strm;
         strm << "dir_cpi_impl::init: cannot handle file: " << dir_url.get_url();

File [modified]: default_file.cpp
Delta lines: +2 -2
===================================================================
--- trunk/adaptors/default/file/default_file.cpp	2009-01-17 12:05:20 UTC (rev 3316)
+++ trunk/adaptors/default/file/default_file.cpp	2009-01-17 12:09:26 UTC (rev 3317)
@@ -20,6 +20,7 @@
 #include <saga/saga/exception.hpp>
 #include <saga/saga/url.hpp>
 #include <saga/saga/adaptors/task.hpp>
+#include <saga/saga/adaptors/utils.hpp>
 
 #include <saga/impl/config.hpp>
 
@@ -49,8 +50,7 @@
   saga::url file_url(data->location_);
   std::string url = saga::url::unescape(file_url.get_path());
 
-  std::string host(file_url.get_host());
-  if (!host.empty() && host != "localhost" && !boost::iequals(host, ::detail::get_hostname()))
+  if ( ! saga::adaptors::utils::url_is_local (file_url) )
   {
     SAGA_OSSTREAM strm;
     strm << "Cannot handle remote file: " << data->location_ ;



More information about the saga-devel mailing list