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/AdminSessionI.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/AdminSessionI.cpp')
-rw-r--r-- | cpp/src/IceGrid/AdminSessionI.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/cpp/src/IceGrid/AdminSessionI.cpp b/cpp/src/IceGrid/AdminSessionI.cpp index b30a1ecddf8..44a634abd5d 100644 --- a/cpp/src/IceGrid/AdminSessionI.cpp +++ b/cpp/src/IceGrid/AdminSessionI.cpp @@ -315,19 +315,20 @@ AdminSessionI::addFileIterator(const FileReaderPrx& reader, throw ex; } - Ice::Long offset = 0; - if(nLines > 0) + // + // Always call getOffsetFromEnd even if nLines < 0. This allows to + // throw right away if the file doesn't exit. + // + Ice::Long offset; + try { - try - { - offset = reader->getOffsetFromEnd(filename, nLines); - } - catch(const Ice::LocalException& ex) - { - ostringstream os; - os << ex; - throw FileNotAvailableException(os.str()); - } + offset = reader->getOffsetFromEnd(filename, nLines); + } + catch(const Ice::LocalException& ex) + { + ostringstream os; + os << ex; + throw FileNotAvailableException(os.str()); } Ice::PropertiesPtr properties = reader->ice_getCommunicator()->getProperties(); |