Skip to content

Commit

Permalink
[XrdCl] xrdcp: allow multiple --cksum options.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal authored and gganis committed Nov 23, 2021
1 parent 94c2a99 commit 9aeb3f1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/XrdApps/XrdCpConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,17 @@ int XrdCpConfig::a2z(const char *item, long long *val,

int XrdCpConfig::defCks(const char *opval)
{
if( CksVal )
{
std::string cksum( opval );
size_t pos = cksum.find( ':' );
std::string mode = cksum.substr( pos + 1 );
if( mode != "source" )
FMSG("Additional checksum must be of mode 'source'.", 13);
AddCksVal.push_back( cksum.substr( 0, pos ) );
return 1;
}

static XrdVERSIONINFODEF(myVer, xrdcp, XrdVNUMBER, XrdVERSION);
const char *Colon = index(opval, ':');
char csName[XrdCksData::NameSize];
Expand Down
3 changes: 3 additions & 0 deletions src/XrdApps/XrdCpConfig.hh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <stdint.h>

#include <string>
#include <vector>

struct option;
class XrdCks;
Expand Down Expand Up @@ -93,6 +94,8 @@ char *zipFile; // The file name if the URL points to a ZIP

static XrdSysError *Log; // -> Error message object

std::vector<std::string> AddCksVal; // -> Additional checksum argument

static const uint64_t OpCksum = 'C'; // -adler -MD5 legacy -> DoCksrc
static const uint64_t DoCksrc = 0x0000000000000001LL; // --cksum <type>:source
static const uint64_t DoCksum = 0x0000000000000002LL; // --cksum <type>
Expand Down

0 comments on commit 9aeb3f1

Please sign in to comment.