summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch2/FileServerI.cpp
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2017-05-02 13:58:41 -0400
committerJoe George <joe@zeroc.com>2017-05-02 15:42:34 -0400
commitcd472ddf8bd8a9c2bcfc80e988e6db450ea7dbf9 (patch)
tree5dbc0bfc43e2c195ab7e7d819e1914611f943f1d /cpp/src/IcePatch2/FileServerI.cpp
parentRemoved trailing whitespace generated by slice2js (diff)
downloadice-cd472ddf8bd8a9c2bcfc80e988e6db450ea7dbf9.tar.bz2
ice-cd472ddf8bd8a9c2bcfc80e988e6db450ea7dbf9.tar.xz
ice-cd472ddf8bd8a9c2bcfc80e988e6db450ea7dbf9.zip
Remove trailing whitespace
Diffstat (limited to 'cpp/src/IcePatch2/FileServerI.cpp')
-rw-r--r--cpp/src/IcePatch2/FileServerI.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/cpp/src/IcePatch2/FileServerI.cpp b/cpp/src/IcePatch2/FileServerI.cpp
index 8170c51df1f..85019e2f69b 100644
--- a/cpp/src/IcePatch2/FileServerI.cpp
+++ b/cpp/src/IcePatch2/FileServerI.cpp
@@ -109,7 +109,7 @@ IcePatch2::FileServerI::getLargeFileCompressed_async(const AMD_FileServer_getLar
{
cb->ice_response(make_pair<const Byte*, const Byte*>(&buffer[0], &buffer[0] + buffer.size()));
}
-
+
}
catch(const std::exception& ex)
{
@@ -118,7 +118,7 @@ IcePatch2::FileServerI::getLargeFileCompressed_async(const AMD_FileServer_getLar
}
void
-IcePatch2::FileServerI::getFileCompressedInternal(const std::string& pa, Ice::Long pos, Ice::Int num,
+IcePatch2::FileServerI::getFileCompressedInternal(const std::string& pa, Ice::Long pos, Ice::Int num,
vector<Byte>& buffer, bool largeFile) const
{
if(IceUtilInternal::isAbsolutePath(pa))
@@ -127,26 +127,26 @@ IcePatch2::FileServerI::getFileCompressedInternal(const std::string& pa, Ice::Lo
}
string path = simplify(pa);
-
+
if(path == ".." ||
path.find("/../") != string::npos ||
(path.size() >= 3 && (path.substr(0, 3) == "../" || path.substr(path.size() - 3, 3) == "/..")))
{
throw FileAccessException(string("illegal `..' component in path `") + path + "'");
}
-
+
if(num <= 0 || pos < 0)
- {
+ {
return;
}
-
+
string absolutePath = _dataDir + '/' + path + ".bz2";
int fd = IceUtilInternal::open(absolutePath, O_RDONLY|O_BINARY);
if(fd == -1)
{
throw FileAccessException(string("cannot open `") + path + "' for reading: " + strerror(errno));
}
-
+
if(!largeFile)
{
IceUtilInternal::structstat buf;
@@ -154,7 +154,7 @@ IcePatch2::FileServerI::getFileCompressedInternal(const std::string& pa, Ice::Lo
{
throw FileAccessException(string("cannot stat `") + path + "':\n" + IceUtilInternal::lastErrorToString());
}
-
+
if(buf.st_size > 0x7FFFFFFF)
{
ostringstream os;