diff options
author | ZeroC Staff <git@zeroc.com> | 2004-01-22 18:58:42 +0000 |
---|---|---|
committer | ZeroC Staff <git@zeroc.com> | 2004-01-22 18:58:42 +0000 |
commit | be30a3b5321248ca3cf2946866f2c99a8afdeded (patch) | |
tree | 1ae3d33befc3a74f146ba8d4d066eecb8fada052 /cpp/src/IcePatch/Util.cpp | |
parent | minor fixes (diff) | |
download | ice-be30a3b5321248ca3cf2946866f2c99a8afdeded.tar.bz2 ice-be30a3b5321248ca3cf2946866f2c99a8afdeded.tar.xz ice-be30a3b5321248ca3cf2946866f2c99a8afdeded.zip |
Added extra file integrity checks to icepatchclient.
Diffstat (limited to 'cpp/src/IcePatch/Util.cpp')
-rw-r--r-- | cpp/src/IcePatch/Util.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/cpp/src/IcePatch/Util.cpp b/cpp/src/IcePatch/Util.cpp index 79950e4a19d..1ee749b8e0d 100644 --- a/cpp/src/IcePatch/Util.cpp +++ b/cpp/src/IcePatch/Util.cpp @@ -532,6 +532,23 @@ IcePatch::createMD5(const string& path, const LoggerPtr& logger) // assert(path != "."); + // + // Calculate and save the MD5 hash value. + // + ByteSeq bytesMD5 = calcMD5(path, logger); + + putMD5(path, bytesMD5); + + if(logger) + { + Trace out(logger, "IcePatch"); + out << "created MD5 file for `" << path << "'"; + } +} + +ByteSeq +IcePatch::calcMD5(const string& path, const LoggerPtr& logger) +{ ByteSeq bytes; FileInfo info = getFileInfo(path, true, logger); @@ -608,16 +625,7 @@ IcePatch::createMD5(const string& path, const LoggerPtr& logger) fill(bytesMD5.begin(), bytesMD5.end(), 0); } - // - // Save the MD5 hash value. - // - putMD5(path, bytesMD5); - - if(logger) - { - Trace out(logger, "IcePatch"); - out << "created MD5 file for `" << path << "'"; - } + return bytesMD5; } ByteSeq |