Skip to content

Commit

Permalink
[XrdEc] Make the metadata files relocable.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal authored and gganis committed Nov 23, 2021
1 parent 3cec830 commit 28eba97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/XrdEc/XrdEcReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@ namespace XrdEc
uint32_t crc32val = crc32c( 0, buffer, lfh.uncompressedSize );
if( crc32val != lfh.ZCRC32 ) return false;
// keep the metadata
metadata.emplace( lfh.filename, buffer_t( buffer, buffer + lfh.uncompressedSize ) );
std::string url = objcfg.GetDataUrl( std::stoull( lfh.filename ) );
metadata.emplace( url, buffer_t( buffer, buffer + lfh.uncompressedSize ) );
buffer += lfh.uncompressedSize;
length -= lfh.uncompressedSize;
}
Expand Down
2 changes: 1 addition & 1 deletion src/XrdEc/XrdEcStrmWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ namespace XrdEc
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
for( size_t i = 0; i < cdcnt; ++i )
{
std::string fn = objcfg.GetDataUrl( i ); // file name (URL of the data archive)
std::string fn = std::to_string( i ); // file name (URL of the data archive)
buffer_t buff( dataarchs[i]->GetCD() ); // raw data buffer (central directory of the data archive)
uint32_t cksum = crc32c( 0, buff.data(), buff.size() ); // crc32c of the buffer
lfhs.emplace_back( fn, cksum, buff.size(), time( 0 ) ); // LFH record for the buffer
Expand Down

0 comments on commit 28eba97

Please sign in to comment.