diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-12-12 10:26:38 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-12-12 10:26:38 +0000 |
commit | da82423dbda5c27ca355c1ad3a22f215c6c8a21b (patch) | |
tree | 2c8f447d3138604e7b49817bbe4ff0ff4aa047f1 /cpp/src/IceGrid/AdminSessionI.cpp | |
parent | Added timeouts (diff) | |
download | ice-da82423dbda5c27ca355c1ad3a22f215c6c8a21b.tar.bz2 ice-da82423dbda5c27ca355c1ad3a22f215c6c8a21b.tar.xz ice-da82423dbda5c27ca355c1ad3a22f215c6c8a21b.zip |
Removed maxLines attribute from FileIterator::read() method
Diffstat (limited to 'cpp/src/IceGrid/AdminSessionI.cpp')
-rw-r--r-- | cpp/src/IceGrid/AdminSessionI.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cpp/src/IceGrid/AdminSessionI.cpp b/cpp/src/IceGrid/AdminSessionI.cpp index 6b9ac62d31b..6785fedf70c 100644 --- a/cpp/src/IceGrid/AdminSessionI.cpp +++ b/cpp/src/IceGrid/AdminSessionI.cpp @@ -22,20 +22,22 @@ using namespace IceGrid; FileIteratorI::FileIteratorI(const AdminSessionIPtr& session, const FileReaderPrx& reader, const string& filename, - Ice::Long offset) : + Ice::Long offset, + int messageSizeMax) : _session(session), _reader(reader), _filename(filename), - _offset(offset) + _offset(offset), + _messageSizeMax(messageSizeMax) { } bool -FileIteratorI::read(int nlines, int size, Ice::StringSeq& lines, const Ice::Current& current) +FileIteratorI::read(int size, Ice::StringSeq& lines, const Ice::Current& current) { try { - return _reader->read(_filename, _offset, nlines, size, _offset, lines); + return _reader->read(_filename, _offset, size > _messageSizeMax ? _messageSizeMax : size, _offset, lines); } catch(const Ice::LocalException& ex) { @@ -321,8 +323,11 @@ AdminSessionI::addFileIterator(const FileReaderPrx& reader, } } + Ice::PropertiesPtr properties = reader->ice_getCommunicator()->getProperties(); + int messageSizeMax = properties->getPropertyAsIntWithDefault("Ice.MessageSizeMax", 1024) * 1024; + Ice::ObjectPrx obj; - Ice::ObjectPtr servant = new FileIteratorI(this, reader, filename, offset); + Ice::ObjectPtr servant = new FileIteratorI(this, reader, filename, offset, messageSizeMax); if(_servantLocator) { obj = _servantLocator->add(servant, current.con); |