Skip to content

Commit

Permalink
[XrdCl] Simplify XRootDMsgHandler::InspectStatusRsp.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal authored and gganis committed Nov 23, 2021
1 parent cce3271 commit faf62ef
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/XrdCl/XrdClAsyncMsgReader.hh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ namespace XrdCl
//----------------------------------------------------------------
if( !inchandler )
{
uint16_t action = strm.InspectStatusRsp( *incmsg, substrmnb,
uint16_t action = strm.InspectStatusRsp( substrmnb,
inchandler );

if( action & IncomingMsgHandler::Corrupted )
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCl/XrdClChannel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace
//------------------------------------------------------------------------
//! Reexamine the incoming message, and decide on the action to be taken
//------------------------------------------------------------------------
virtual uint16_t InspectStatusRsp( XrdCl::Message &msg )
virtual uint16_t InspectStatusRsp()
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCl/XrdClPostMasterInterfaces.hh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace XrdCl
//! @return action type that needs to be take wrt the message and
//! the handler
//------------------------------------------------------------------------
virtual uint16_t InspectStatusRsp( Message &msg ) = 0;
virtual uint16_t InspectStatusRsp() = 0;

//------------------------------------------------------------------------
//! Get handler sid
Expand Down
5 changes: 2 additions & 3 deletions src/XrdCl/XrdClStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1115,14 +1115,13 @@ namespace XrdCl
//!
//! @return : a IncomingMsgHandler in case we need to read out raw data
//----------------------------------------------------------------------------
uint16_t Stream::InspectStatusRsp( Message &msg,
uint16_t stream,
uint16_t Stream::InspectStatusRsp( uint16_t stream,
IncomingMsgHandler *&incHandler )
{
InMessageHelper &mh = pSubStreams[stream]->inMsgHelper;
if( !mh.handler ) return false;

uint16_t action = mh.handler->InspectStatusRsp( msg );
uint16_t action = mh.handler->InspectStatusRsp();
mh.action |= action;

if( action & IncomingMsgHandler::RemoveHandler )
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCl/XrdClStream.hh
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ namespace XrdCl
//!
//! @return : a IncomingMsgHandler in case we need to read out raw data
//------------------------------------------------------------------------
uint16_t InspectStatusRsp( Message &msg, uint16_t stream, IncomingMsgHandler *&incHandler );
uint16_t InspectStatusRsp( uint16_t stream, IncomingMsgHandler *&incHandler );

//------------------------------------------------------------------------
//! Set the on-connect handler for data streams
Expand Down
14 changes: 7 additions & 7 deletions src/XrdCl/XrdClXRootDMsgHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ namespace XrdCl
//----------------------------------------------------------------------------
// Reexamine the incoming message, and decide on the action to be taken
//----------------------------------------------------------------------------
uint16_t XRootDMsgHandler::InspectStatusRsp( Message &msg )
uint16_t XRootDMsgHandler::InspectStatusRsp()
{
Log *log = DefaultEnv::GetLog();
ServerResponse *rsp = (ServerResponse *)msg.GetBuffer();
ServerResponse *rsp = (ServerResponse *)pResponse->GetBuffer();

//--------------------------------------------------------------------------
// Additional action is only required for kXR_status
Expand All @@ -337,7 +337,7 @@ namespace XrdCl
//--------------------------------------------------------------------------
// Ignore malformed status response
//--------------------------------------------------------------------------
if( msg.GetSize() < sizeof( ServerResponseStatus ) )
if( pResponse->GetSize() < sizeof( ServerResponseStatus ) )
return Ignore;

ClientRequest *req = (ClientRequest *)pRequest->GetBuffer();
Expand All @@ -347,7 +347,7 @@ namespace XrdCl
//--------------------------------------------------------------------------
if( !pRspStatusBodyUnMarshaled )
{
XRootDStatus st = XRootDTransport::UnMarshalStatusBody( msg, reqId );
XRootDStatus st = XRootDTransport::UnMarshalStatusBody( *pResponse, reqId );

if( !st.IsOK() && st.code == errDataError )
{
Expand All @@ -370,7 +370,7 @@ namespace XrdCl
//--------------------------------------------------------------------------
// Common handling for partial results
//--------------------------------------------------------------------------
ServerResponseStatus *rspst = (ServerResponseStatus*)msg.GetBuffer();
ServerResponseStatus *rspst = (ServerResponseStatus*)pResponse->GetBuffer();
if( rspst->bdy.resptype == XrdProto::kXR_PartialResult )
{
pPartialResps.push_back( std::move( pResponse ) );
Expand Down Expand Up @@ -407,12 +407,12 @@ namespace XrdCl
// send some additional data pointing to the pages that need to be
// retransmitted
if( size_t( sizeof( ServerResponseHeader ) + rspst->hdr.dlen + rspst->bdy.dlen ) >
msg.GetCursor() )
pResponse->GetCursor() )
action |= More;
// if we already have this data we need to unmarshal it
else if( !pRspPgWrtRetrnsmReqUnMarshalled )
{
XRootDStatus st = XRootDTransport::UnMarchalStatusCSE( msg );
XRootDStatus st = XRootDTransport::UnMarchalStatusCSE( *pResponse );
if( !st.IsOK() && st.code == errDataError )
{
log->Error( XRootDMsg, "[%s] %s", pUrl.GetHostId().c_str(),
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCl/XrdClXRootDMsgHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ namespace XrdCl
//! @return action type that needs to be take wrt the message and
//! the handler
//------------------------------------------------------------------------
virtual uint16_t InspectStatusRsp( Message &msg );
virtual uint16_t InspectStatusRsp();

//------------------------------------------------------------------------
//! Get handler sid
Expand Down

0 comments on commit faf62ef

Please sign in to comment.