diff options
author | Marc Laukien <marc@zeroc.com> | 2002-09-02 11:34:16 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-09-02 11:34:16 +0000 |
commit | 474ec67beabdb612c633d35fd9562b349aa74b7a (patch) | |
tree | 2a3f2036f3269538b73dcec6492be6cb097ef3df /cpp | |
parent | minor (diff) | |
download | ice-474ec67beabdb612c633d35fd9562b349aa74b7a.tar.bz2 ice-474ec67beabdb612c633d35fd9562b349aa74b7a.tar.xz ice-474ec67beabdb612c633d35fd9562b349aa74b7a.zip |
more IcePatch work
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/config/TestUtil.py | 2 | ||||
-rw-r--r-- | cpp/src/IcePatch/FileLocator.cpp | 9 | ||||
-rw-r--r-- | cpp/src/IcePatch/Util.cpp | 26 |
3 files changed, 24 insertions, 13 deletions
diff --git a/cpp/config/TestUtil.py b/cpp/config/TestUtil.py index 3c92e99f7c5..9519e2c437e 100644 --- a/cpp/config/TestUtil.py +++ b/cpp/config/TestUtil.py @@ -63,7 +63,7 @@ if host != "": else: defaultHost = "" -commonServerOptions = " --Ice.ServerThreadPool.Size=3 --Ice.PrintProcessId --Ice.PrintAdapterReady" + \ +commonServerOptions = " --Ice.PrintProcessId --Ice.PrintAdapterReady --Ice.ServerThreadPool.Size=3" + \ " --Ice.ConnectionWarnings --Ice.ServerIdleTime=30" serverOptions = commonServerOptions + serverProtocol diff --git a/cpp/src/IcePatch/FileLocator.cpp b/cpp/src/IcePatch/FileLocator.cpp index 329cec2ce98..1a1e5b25826 100644 --- a/cpp/src/IcePatch/FileLocator.cpp +++ b/cpp/src/IcePatch/FileLocator.cpp @@ -35,11 +35,6 @@ IcePatch::FileLocator::locate(const ObjectAdapterPtr& adapter, const Current& cu return 0; } - if(path == ".") - { - return 0; - } - if(path[0] == '/') // Example: /usr/mail/foo { return 0; @@ -47,7 +42,7 @@ IcePatch::FileLocator::locate(const ObjectAdapterPtr& adapter, const Current& cu // // Note: We could make the following rule more selective, to allow - // names such as "...foo". But since such names are rather + // names such as "foo..bar". But since such names are rather // uncommon, we disallow ".." altogether, to be on the safe side. // if(path.find("..") != string::npos) // Example: foo/../.. @@ -55,7 +50,7 @@ IcePatch::FileLocator::locate(const ObjectAdapterPtr& adapter, const Current& cu return 0; } - if(path.find(':') == 1) // Example: c:\blah + if(path.size() >= 2 && tolower(path[0]) >= 'a' && tolower(path[0]) <= 'z' && path[1] == ':') // Example: c:\blah { return 0; } diff --git a/cpp/src/IcePatch/Util.cpp b/cpp/src/IcePatch/Util.cpp index 82d33275f09..d8ebeef999b 100644 --- a/cpp/src/IcePatch/Util.cpp +++ b/cpp/src/IcePatch/Util.cpp @@ -375,19 +375,34 @@ IcePatch::createMD5(const string& path) throw ex; } + string pathMD5; + string pathMD5Temp; ByteSeq bytes; if(info.type == FileTypeDirectory) { + pathMD5 = path + "/.md5"; + pathMD5Temp = path + "/.md5temp"; + // // Read all MD5 files in the directory. // StringSeq paths = readDirectory(path); for(StringSeq::const_iterator p = paths.begin(); p != paths.end(); ++p) { - if(getSuffix(*p) == "md5") + if(!ignoreSuffix(*p)) { - ByteSeq md5 = getMD5(removeSuffix(*p)); - copy(md5.begin(), md5.end(), back_inserter(bytes)); + FileInfo subInfo = getFileInfo(*p, true); + + if(subInfo.type == FileTypeDirectory) + { + ByteSeq subBytesMD5 = getMD5(*p + "/.md5"); + copy(subBytesMD5.begin(), subBytesMD5.end(), back_inserter(bytes)); + } + else if(subInfo.type == FileTypeRegular) + { + ByteSeq subBytesMD5 = getMD5(removeSuffix(*p)); + copy(subBytesMD5.begin(), subBytesMD5.end(), back_inserter(bytes)); + } } } } @@ -395,6 +410,9 @@ IcePatch::createMD5(const string& path) { assert(info.type == FileTypeRegular); + pathMD5 = path + ".md5"; + pathMD5Temp = path + ".md5temp"; + // // Read the original file. // @@ -432,8 +450,6 @@ IcePatch::createMD5(const string& path) // // Save the MD5 hash value to a temporary MD5 file. // - string pathMD5 = path + ".md5"; - string pathMD5Temp = path + ".md5temp"; ofstream fileMD5(pathMD5Temp.c_str(), ios::binary); if(!fileMD5) { |