Skip to content

Commit

Permalink
[XrdCl] If stream is broken delete the in-message.
Browse files Browse the repository at this point in the history
And some indetation readjustments.
  • Loading branch information
simonmichal committed Apr 25, 2018
1 parent d1c76f2 commit 79cefa2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
3 changes: 3 additions & 0 deletions src/XrdCl/XrdClAsyncSocketHandler.cc
Expand Up @@ -954,6 +954,9 @@ namespace XrdCl
// called from inside of Stream::OnReadTimeout, this
// in turn means that the ownership of following
// pointers, has been transfered to the inQueue
if( !pIncHandler.second )
delete pIncoming;

pIncoming = 0;
pOutgoing = 0;
pOutHandler = 0;
Expand Down
10 changes: 5 additions & 5 deletions src/XrdCl/XrdClFileSystem.cc
Expand Up @@ -692,11 +692,11 @@ namespace XrdCl
{
HostList::reverse_iterator it;
for( it = hostList->rbegin(); it != hostList->rend(); ++it )
if( it->loadBalancer )
{
pFS->AssignLoadBalancer( it->url );
break;
}
if( it->loadBalancer )
{
pFS->AssignLoadBalancer( it->url );
break;
}
}
pUserHandler->HandleResponseWithHosts( status, response, hostList );
delete this;
Expand Down
22 changes: 11 additions & 11 deletions src/XrdCl/XrdClInQueue.cc
Expand Up @@ -83,7 +83,7 @@ namespace XrdCl
action = handler->Examine( msg );

if( action & IncomingMsgHandler::RemoveHandler )
pHandlers.erase( it );
pHandlers.erase( it );
}

if( !(action & IncomingMsgHandler::Take) )
Expand Down Expand Up @@ -113,10 +113,10 @@ namespace XrdCl

if( action & IncomingMsgHandler::Take )
{
if( !(action & IncomingMsgHandler::NoProcess ) )
handler->Process( it->second );
if( !(action & IncomingMsgHandler::NoProcess ) )
handler->Process( it->second );

pMessages.erase( it );
pMessages.erase( it );
}
}

Expand Down Expand Up @@ -152,7 +152,7 @@ namespace XrdCl
exp = it->second.second;

if( act & IncomingMsgHandler::Take )
pHandlers.erase( it );
pHandlers.erase( it );
}

if( handler )
Expand Down Expand Up @@ -199,9 +199,9 @@ namespace XrdCl
action = it->second.first->OnStreamEvent( event, streamNum, status );

if( action & IncomingMsgHandler::RemoveHandler )
pHandlers.erase( it++ );
pHandlers.erase( it++ );
else
++it;
++it;
}
}

Expand All @@ -219,12 +219,12 @@ namespace XrdCl
{
if( it->second.second <= now )
{
it->second.first->OnStreamEvent( IncomingMsgHandler::Timeout, 0,
Status( stError, errOperationExpired ) );
pHandlers.erase( it++ );
it->second.first->OnStreamEvent( IncomingMsgHandler::Timeout, 0,
Status( stError, errOperationExpired ) );
pHandlers.erase( it++ );
}
else
++it;
++it;
}
}
}

0 comments on commit 79cefa2

Please sign in to comment.