Skip to content

Commit

Permalink
[XrdCl] bugfix for the tape-server.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed Jan 25, 2017
1 parent c538e00 commit c3e409a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
14 changes: 13 additions & 1 deletion src/XrdCl/XrdClAsyncSocketHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,19 @@ namespace XrdCl
//----------------------------------------------------------------------------
void AsyncSocketHandler::OnReadTimeout()
{
pStream->OnReadTimeout( pSubStreamNum );
bool isBroken = false;
pStream->OnReadTimeout( pSubStreamNum, isBroken );

if( isBroken )
{
// if we are here it means Stream::OnError has been
// called from inside of Stream::OnReadTimeout, this
// in turn means that the ownership of following
// pointers, has been transfered to the inQueue
pIncoming = 0;
pOutgoing = 0;
pOutHandler = 0;
}
}

//----------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion src/XrdCl/XrdClStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,10 @@ namespace XrdCl
//----------------------------------------------------------------------------
// Call back when a message has been reconstructed
//----------------------------------------------------------------------------
void Stream::OnReadTimeout( uint16_t substream )
void Stream::OnReadTimeout( uint16_t substream, bool &isBroken )
{
isBroken = false;

//--------------------------------------------------------------------------
// We only take the main stream into account
//--------------------------------------------------------------------------
Expand Down Expand Up @@ -953,6 +955,7 @@ namespace XrdCl
*pChannelData );
if( !st.IsOK() )
{
isBroken = true;
scopedLock.UnLock();
OnError( substream, st );
}
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCl/XrdClStream.hh
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ namespace XrdCl
//------------------------------------------------------------------------
//! On read timeout
//------------------------------------------------------------------------
void OnReadTimeout( uint16_t subStream );
void OnReadTimeout( uint16_t subStream, bool &isBroken );

//------------------------------------------------------------------------
//! On write timeout
Expand Down

0 comments on commit c3e409a

Please sign in to comment.