diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-01-25 14:17:48 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-01-25 14:17:48 +0000 |
commit | 0d6e66e98a11e8fa70d53c9e304eaf08bfc0a072 (patch) | |
tree | 1b1a7ce9b43ca3c4b4d2f1e138ee6dd9716fb70c /cpp/src/IceGrid/ServerI.cpp | |
parent | http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1283 (diff) | |
download | ice-0d6e66e98a11e8fa70d53c9e304eaf08bfc0a072.tar.bz2 ice-0d6e66e98a11e8fa70d53c9e304eaf08bfc0a072.tar.xz ice-0d6e66e98a11e8fa70d53c9e304eaf08bfc0a072.zip |
IceGrid file cache fixes
Diffstat (limited to 'cpp/src/IceGrid/ServerI.cpp')
-rw-r--r-- | cpp/src/IceGrid/ServerI.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index 27c9352ac37..e767ca6bc58 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -1972,10 +1972,22 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor) } // - // Make sure the log paths are sorted. + // Simplify the log paths and transform relative paths into + // absolute paths, also make sure the logs are sorted. // - _logs = _desc->logs; - sort(_desc->logs.begin(), _desc->logs.begin()); + for(Ice::StringSeq::const_iterator p = _desc->logs.begin(); p != _desc->logs.end(); ++p) + { + string path = IcePatch2::simplify(*p); + if(IcePatch2::isAbsolute(path)) + { + _logs.push_back(path); + } + else + { + _logs.push_back(_node->getPlatformInfo().getCwd() + '/' + path); + } + } + sort(_logs.begin(), _logs.begin()); // // Copy the descriptor properties. We shouldn't modify the @@ -2648,7 +2660,11 @@ ServerI::getFilePath(const string& filename) const else if(!filename.empty() && filename[0] == '#') { string path = IcePatch2::simplify(filename.substr(1)); - if(find(_desc->logs.begin(), _desc->logs.end(), path) == _desc->logs.end()) + if(!IcePatch2::isAbsolute(path)) + { + path = _node->getPlatformInfo().getCwd() + "/" + path; + } + if(find(_logs.begin(), _logs.end(), path) == _logs.end()) { throw FileNotAvailableException("unknown log file `" + path + "'"); } |