Skip to content

Commit

Permalink
[XrdEc] StrmWriter: use ZipArchive::AppendFile.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed Jan 15, 2021
1 parent 7b53cba commit fbf8002
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions src/XrdEc/XrdEcStrmWriter.hh
Expand Up @@ -414,27 +414,31 @@ namespace XrdEc
//-------------------------------------------------------------------
// Create the Write request
//-------------------------------------------------------------------
XrdCl::Pipeline p = XrdCl::Write( zip, strpsize, strpbuff ) >> // TODO replace Write with WriteTo
[=]( XrdCl::XRootDStatus &st ) mutable
{
//---------------------------------------------
// Try to recover from error
//---------------------------------------------
if( !st.IsOK() )
{
//-------------------------------------------
// Select another server
//-------------------------------------------
size_t srvid;
if( !servers->dequeue( srvid ) ) return; // if there are no more servers we simply fail
zip = *dataarchs[srvid];
//-------------------------------------------
// Retry this operation at different server
//-------------------------------------------
XrdCl::Pipeline::Repeat();
}
}
| XrdCl::Final( [wrtbuff]( const XrdCl::XRootDStatus &st ){ } );
XrdCl::Pipeline p = XrdCl::AppendFile( zip, fn, crc32c, strpsize, strpbuff ) >>
[=]( XrdCl::XRootDStatus &st ) mutable
{
//---------------------------------------------
// Try to recover from error
//---------------------------------------------
if( !st.IsOK() )
{
//-------------------------------------------
// Select another server
//-------------------------------------------
size_t srvid;
if( !servers->dequeue( srvid ) ) return; // if there are no more servers we simply fail
zip = *dataarchs[srvid];
//-------------------------------------------
// Retry this operation at different server
//-------------------------------------------
XrdCl::Pipeline::Repeat();
}
//---------------------------------------------
// Make sure the buffer is only deallocated
// after the handler is called
//---------------------------------------------
wrtbuff.reset();
};
writes.emplace_back( std::move( p ) );
}

Expand Down

0 comments on commit fbf8002

Please sign in to comment.