summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/FileCache.cpp
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2021-01-28 16:26:44 -0500
committerJoe George <joe@zeroc.com>2021-02-01 16:59:30 -0500
commit92a6531e409f2691d82591e185a92299d415fc0f (patch)
tree60c79e2a8f327b8f0b6ebc06b06f48a2e8086f6a /cpp/src/IceGrid/FileCache.cpp
parentPort Glacier2, IceBox, IceBridge, IceDB, IceXML, icegriddb (diff)
downloadice-92a6531e409f2691d82591e185a92299d415fc0f.tar.bz2
ice-92a6531e409f2691d82591e185a92299d415fc0f.tar.xz
ice-92a6531e409f2691d82591e185a92299d415fc0f.zip
IceGrid and IceStorm
Diffstat (limited to 'cpp/src/IceGrid/FileCache.cpp')
-rw-r--r--cpp/src/IceGrid/FileCache.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/cpp/src/IceGrid/FileCache.cpp b/cpp/src/IceGrid/FileCache.cpp
index 565e7896e62..ba06b25d61d 100644
--- a/cpp/src/IceGrid/FileCache.cpp
+++ b/cpp/src/IceGrid/FileCache.cpp
@@ -16,12 +16,12 @@
using namespace std;
using namespace IceGrid;
-FileCache::FileCache(const Ice::CommunicatorPtr& com) :
- _messageSizeMax(com->getProperties()->getPropertyAsIntWithDefault("Ice.MessageSizeMax", 1024) * 1024 - 256)
+FileCache::FileCache(const shared_ptr<Ice::Communicator>& com) :
+ _messageMaxSize(com->getProperties()->getPropertyAsIntWithDefault("Ice.MessageMaxSize", 1024) * 1024 - 256)
{
}
-Ice::Long
+long long
FileCache::getOffsetFromEnd(const string& file, int originalCount)
{
ifstream is(IceUtilInternal::streamFilename(file).c_str()); // file is a UTF-8 string
@@ -108,7 +108,7 @@ FileCache::getOffsetFromEnd(const string& file, int originalCount)
if(is.bad())
{
- throw FileNotAvailableException("unrecoverable error occured while reading file `" + file + "'");
+ throw FileNotAvailableException("unrecoverable error occurred while reading file `" + file + "'");
}
if(lines.empty())
@@ -122,13 +122,13 @@ FileCache::getOffsetFromEnd(const string& file, int originalCount)
}
bool
-FileCache::read(const string& file, Ice::Long offset, int size, Ice::Long& newOffset, Ice::StringSeq& lines)
+FileCache::read(const string& file, long long offset, int size, long long& newOffset, Ice::StringSeq& lines)
{
assert(size > 0);
- if(size > _messageSizeMax)
+ if(size > _messageMaxSize)
{
- size = _messageSizeMax;
+ size = _messageMaxSize;
}
if(size <= 5)
@@ -205,7 +205,7 @@ FileCache::read(const string& file, Ice::Long offset, int size, Ice::Long& newOf
if(is.bad())
{
- throw FileNotAvailableException("unrecoverable error occured while reading file `" + file + "'");
+ throw FileNotAvailableException("unrecoverable error occurred while reading file `" + file + "'");
}
return is.eof();