Commit 0521408a authored by David COME's avatar David COME
Browse files

changes to initAdler32Checksum

Move to a static member function of payload and renamed it zeroAdler32
parent b60c2cad
......@@ -24,12 +24,7 @@
#include "castor/tape/tapeserver/daemon/DiskWriteTask.hpp"
#include "castor/tape/tapeserver/daemon/AutoReleaseBlock.hpp"
namespace {
//todo : merge it with one of TapeWriteTask and put is somewhere
unsigned long initAdler32Checksum() {
return adler32(0L,Z_NULL,0);
}
}
namespace castor {
namespace tape {
namespace tapeserver {
......@@ -54,7 +49,7 @@ namespace daemon {
try{
tape::diskFile::WriteFile ourFile(m_recallingFile->path());
int blockId = 0;
unsigned long checksum = initAdler32Checksum();
unsigned long checksum = Payload::zeroAdler32();
while(1) {
if(MemBlock* const mb = m_fifo.pop()) {
AutoReleaseBlock<RecallMemoryManager> releaser(mb,m_memManager);
......
......@@ -142,6 +142,9 @@ public:
unsigned long adler32(unsigned long previous){
return ::adler32(previous,m_payload,m_size);
}
static unsigned long zeroAdler32() {
return ::adler32(0L,Z_NULL,0);
}
private:
unsigned char* m_payload;
size_t m_totalCapacity;
......
......@@ -60,7 +60,7 @@ namespace daemon {
using castor::log::LogContext;
using castor::log::Param;
unsigned long ckSum = initAdler32Checksum();
unsigned long ckSum = Payload::zeroAdler32();
int blockId = 0;
try {
std::auto_ptr<castor::tape::tapeFile::WriteFile> output(openWriteFile(session,lc));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment