Skip to content

Commit

Permalink
[XrdCl] Fix zip ls timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed Oct 11, 2018
1 parent 459973a commit 2ffef37
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/XrdCl/XrdClZipListHandler.cc
Expand Up @@ -33,6 +33,12 @@ namespace XrdCl
std::unique_ptr<XRootDStatus> status( statusptr );
std::unique_ptr<AnyObject> response( responseptr );

if( pStep == DONE )
{
delete this;
return;
}

if( !status->IsOK() )
{
pHandler->HandleResponse( status.release(), response.release() );
Expand All @@ -45,7 +51,13 @@ namespace XrdCl
{
*status = XRootDStatus( stError, errOperationExpired );
pHandler->HandleResponse( status.release(), 0 );
delete this;
if( pZip.IsOpen() )
{
DoZipClose( 1 );
pStep = DONE;
}
else
delete this;
return;
}
uint16_t left = pTimeout - took;
Expand Down
9 changes: 9 additions & 0 deletions src/XrdCl/XrdClZipListHandler.hh
Expand Up @@ -29,6 +29,8 @@
#include "XrdCl/XrdClFileSystem.hh"
#include "XrdCl/XrdClFile.hh"
#include "XrdCl/XrdClZipArchiveReader.hh"
#include "XrdCl/XrdClConstants.hh"
#include "XrdCl/XrdClDefaultEnv.hh"

#include <string>
#include <memory>
Expand Down Expand Up @@ -77,6 +79,13 @@ namespace XrdCl
pTimeout( timeout ), pStartTime( time( 0 ) ),
pZip( pFile ), pStep( STAT )
{
if( !pTimeout )
{
int val = DefaultRequestTimeout;
DefaultEnv::GetEnv()->GetInt( "RequestTimeout", val );
pTimeout = val;
}

pUrl.SetPath( path );
}

Expand Down

0 comments on commit 2ffef37

Please sign in to comment.