Propagator: checksum constants go to propatorjobs header.

So they can be used from both up- and download propagator jobs.
This commit is contained in:
Klaas Freitag 2015-05-15 10:50:13 +02:00
parent 3701fbcbfe
commit e18fd62f34
2 changed files with 17 additions and 9 deletions

View file

@ -43,14 +43,6 @@ const char owncloudShouldSoftCancelPropertyName[] = "owncloud-should-soft-cancel
namespace OCC { namespace OCC {
/**
* Tags for checksum headers.
*/
static const char checkSumMD5C[] = "MD5";
static const char checkSumSHA1C[] = "SHA1";
static const char checkSumAdlerC[] = "Adler32";
static const char checkSumAdlerUpperC[] = "ADLER32";
/** /**
* We do not want to upload files that are currently being modified. * We do not want to upload files that are currently being modified.
* To avoid that, we don't upload files that have a modification time * To avoid that, we don't upload files that have a modification time
@ -503,7 +495,7 @@ void PropagateUploadFileQNAM::startNextChunk()
currentChunkSize = chunkSize(); currentChunkSize = chunkSize();
} }
if( !_item._checksum.isEmpty() ) { if( !_item._checksum.isEmpty() ) {
headers["OC-Checksum"] = _item._checksum; headers[checkSumHeaderC] = _item._checksum;
} }
} }
} }

View file

@ -21,6 +21,22 @@
namespace OCC { namespace OCC {
/**
* Tags for checksum headers.
* They are here for being shared between Upload- and Download Job
*/
// the header itself
static const char checkSumHeaderC[] = "OC-Checksum";
// ...and it's values
static const char checkSumMD5C[] = "MD5";
static const char checkSumSHA1C[] = "SHA1";
static const char checkSumAdlerC[] = "Adler32";
static const char checkSumAdlerUpperC[] = "ADLER32";
/**
* Declaration of the other propation jobs
*/
class PropagateLocalRemove : public PropagateItemJob { class PropagateLocalRemove : public PropagateItemJob {
Q_OBJECT Q_OBJECT
public: public: