diff options
author | Marc Laukien <marc@zeroc.com> | 2002-04-28 13:53:42 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-04-28 13:53:42 +0000 |
commit | ee69188a792f0d2b85838256496b51d685689fa1 (patch) | |
tree | 54c36305a192fadea82ee551b7b19ff35d97738f /cpp/src/IcePatch/IcePatchI.cpp | |
parent | python test scripts cleanup (diff) | |
download | ice-ee69188a792f0d2b85838256496b51d685689fa1.tar.bz2 ice-ee69188a792f0d2b85838256496b51d685689fa1.tar.xz ice-ee69188a792f0d2b85838256496b51d685689fa1.zip |
partial retransmission for IcePatch
Diffstat (limited to 'cpp/src/IcePatch/IcePatchI.cpp')
-rw-r--r-- | cpp/src/IcePatch/IcePatchI.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cpp/src/IcePatch/IcePatchI.cpp b/cpp/src/IcePatch/IcePatchI.cpp index 04757c3d061..881ede32971 100644 --- a/cpp/src/IcePatch/IcePatchI.cpp +++ b/cpp/src/IcePatch/IcePatchI.cpp @@ -225,3 +225,37 @@ IcePatch::RegularI::getBZ2(Ice::Int pos, Ice::Int num, const Ice::Current& curre throw BusyException(); } } + +ByteSeq +IcePatch::RegularI::getBZ2MD5(Ice::Int size, const Ice::Current& current) +{ + try + { + IceUtil::RWRecMutex::TryRLock sync(_globalMutex, _busyTimeout); + string path = identityToPath(current.identity); + + FileInfo info = getFileInfo(path, true); + FileInfo infoBZ2 = getFileInfo(path + ".bz2", false); + if (infoBZ2.type != FileTypeRegular || infoBZ2.time < info.time) + { + sync.timedUpgrade(_busyTimeout); + infoBZ2 = getFileInfo(path + ".bz2", false); + if (infoBZ2.type != FileTypeRegular || infoBZ2.time < info.time) + { + createBZ2(path); + + if (_traceLevel > 0) + { + Trace out(_logger, "IcePatch"); + out << "created .bz2 file for `" << path << "'"; + } + } + } + + return IcePatch::getPartialMD5(path + ".bz2", size); + } + catch (const IceUtil::LockedException&) + { + throw BusyException(); + } +} |