xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
XrdClientConn Class Reference

#include <XrdClientConn.hh>

Collaboration diagram for XrdClientConn:
Collaboration graph
[legend]

Classes

struct  SessionIDInfo
 

Public Types

enum  ESrvErrorHandlerRetval {
  kSEHRReturnMsgToCaller = 0, kSEHRBreakLoop = 1, kSEHRContinue = 2, kSEHRReturnNoMsgToCaller = 3,
  kSEHRRedirLimitReached = 4
}
 
enum  EThreeStateReadHandler { kTSRHReturnMex = 0, kTSRHReturnNullMex = 1, kTSRHContinue = 2 }
 

Public Member Functions

 XrdClientConn ()
 
virtual ~XrdClientConn ()
 
bool CacheWillFit (long long bytes)
 
bool CheckHostDomain (XrdOucString hostToCheck)
 
short Connect (XrdClientUrlInfo Host2Conn, XrdClientAbsUnsolMsgHandler *unsolhandler)
 
void Disconnect (bool ForcePhysicalDisc)
 
virtual bool GetAccessToSrv ()
 
XReqErrorType GoBackToRedirector ()
 
XrdOucString GetClientHostDomain ()
 
long GetDataFromCache (const void *buffer, long long begin_offs, long long end_offs, bool PerfCalc, XrdClientIntvList &missingblks, long &outstandingblks)
 
bool SubmitDataToCache (XrdClientMessage *xmsg, long long begin_offs, long long end_offs)
 
bool SubmitRawDataToCache (const void *buffer, long long begin_offs, long long end_offs)
 
void SubmitPlaceholderToCache (long long begin_offs, long long end_offs)
 
void RemoveAllDataFromCache (bool keepwriteblocks=true)
 
void RemoveDataFromCache (long long begin_offs, long long end_offs, bool remove_overlapped=false)
 
void RemovePlaceholdersFromCache ()
 
void PrintCache ()
 
bool GetCacheInfo (int &size, long long &bytessubmitted, long long &byteshit, long long &misscount, float &missrate, long long &readreqcnt, float &bytesusefulness)
 
void SetCacheSize (int CacheSize)
 
void SetCacheRmPolicy (int RmPolicy)
 
void UnPinCacheBlk (long long begin_offs, long long end_offs)
 
int GetLogConnID () const
 
ERemoteServerType GetServerType () const
 
kXR_unt16 GetStreamID () const
 
XrdClientUrlInfo * GetLBSUrl ()
 
XrdClientUrlInfo * GetMetaUrl ()
 
XrdClientUrlInfo GetCurrentUrl ()
 
XrdClientUrlInfo GetRedirUrl ()
 
XErrorCode GetOpenError () const
 
virtual XReqErrorType GoToAnotherServer (XrdClientUrlInfo &newdest)
 
virtual XReqErrorType GoToMetaManager ()
 
bool IsConnected () const
 
bool IsPhyConnConnected ()
 
void ClearLastServerError ()
 
UnsolRespProcResult ProcessAsynResp (XrdClientMessage *unsolmsg)
 
virtual bool SendGenCommand (ClientRequest *req, const void *reqMoreData, void **answMoreDataAllocated, void *answMoreData, bool HasToAlloc, char *CmdName, int substreamid=0)
 
int GetOpenSockFD () const
 
void SetClientHostDomain (const char *src)
 
void SetConnected (bool conn)
 
void SetOpenError (XErrorCode err)
 
int GetParallelStreamToUse (int reqsperstream)
 
int GetParallelStreamCount ()
 
void SetRedirHandler (XrdClientAbs *rh)
 
void SetRequestedDestHost (char *newh, kXR_int32 port)
 
void SetREQPauseState (kXR_int32 wsec)
 
void SetREQDelayedConnectState (kXR_int32 wsec)
 
void SetSID (kXR_char *sid)
 
void SetUrl (XrdClientUrlInfo thisUrl)
 
XReqErrorType WriteToServer_Async (ClientRequest *req, const void *reqMoreData, int substreamid=0)
 
void GetSessionID (SessionIDInfo &sess)
 
long GetServerProtocol ()
 
short GetMaxRedirCnt () const
 
void SetMaxRedirCnt (short mx)
 
short GetRedirCnt () const
 
bool DoWriteSoftCheckPoint ()
 
bool DoWriteHardCheckPoint ()
 
void UnPinCacheBlk ()
 
void SetOpTimeLimit (int delta_secs)
 
bool IsOpTimeLimitElapsed (time_t timenow)
 

Static Public Member Functions

static XrdClientPhyConnection * GetPhyConn (int LogConnID)
 
static XrdClientConnectionMgr * GetConnectionMgr ()
 
static void DelSessionIDRepo ()
 

Public Attributes

int fLastDataBytesRecv
 
int fLastDataBytesSent
 
XErrorCode fOpenError
 
XrdOucString fRedirOpaque
 
struct ServerResponseHeader LastServerResp
 
struct ServerResponseBody_Error LastServerError
 
XrdOucString fRedirCGI
 

Protected Member Functions

void SetLogConnID (int cid)
 
void SetStreamID (kXR_unt16 sid)
 

Protected Attributes

XrdClientAbsUnsolMsgHandler * fUnsolMsgHandler
 
XrdClientUrlInfo fUrl
 
XrdClientUrlInfo * fLBSUrl
 
XrdClientUrlInfo fREQUrl
 
short fGlobalRedirCnt
 

Private Member Functions

bool CheckErrorStatus (XrdClientMessage *, short &, char *)
 
void CheckPort (int &port)
 
void CheckREQPauseState ()
 
void CheckREQConnectWaitState ()
 
bool CheckResp (struct ServerResponseHeader *resp, const char *method)
 
XrdClientMessage * ClientServerCmd (ClientRequest *req, const void *reqMoreData, void **answMoreDataAllocated, void *answMoreData, bool HasToAlloc, int substreamid=0)
 
XrdSecProtocol * DoAuthentication (char *plist, int plsiz)
 
ERemoteServerType DoHandShake (short log)
 
bool DoLogin ()
 
bool DomainMatcher (XrdOucString dom, XrdOucString domlist)
 
XrdOucString GetDomainToMatch (XrdOucString hostname)
 
ESrvErrorHandlerRetval HandleServerError (XReqErrorType &, XrdClientMessage *, ClientRequest *)
 
bool MatchStreamid (struct ServerResponseHeader *ServerResponse)
 
bool PanicClose ()
 
XrdOucString ParseDomainFromHostname (XrdOucString hostname)
 
XrdClientMessage * ReadPartialAnswer (XReqErrorType &, size_t &, ClientRequest *, bool, void **, EThreeStateReadHandler &)
 
XReqErrorType WriteToServer (ClientRequest *req, const void *reqMoreData, short LogConnID, int substreamid=0)
 
bool WaitResp (int secsmax)
 

Private Attributes

bool fConnected
 
bool fGettingAccessToSrv
 
time_t fGlobalRedirLastUpdateTimestamp
 
int fLogConnID
 
kXR_unt16 fPrimaryStreamid
 
short fMaxGlobalRedirCnt
 
XrdClientReadCache * fMainReadCache
 
time_t fOpTimeLimit
 
XrdClientAbs * fRedirHandler
 
XrdOucString fRedirInternalToken
 
XrdSysCondVar * fREQWaitResp
 
ServerResponseBody_Attn_asynresp * fREQWaitRespData
 
time_t fREQWaitTimeLimit
 
XrdSysCondVar * fREQWait
 
time_t fREQConnectWaitTimeLimit
 
XrdSysCondVar * fREQConnectWait
 
long fServerProto
 
ERemoteServerType fServerType
 
SessionIDInfo mySessionID
 
int fOpenSockFD
 
XrdSysCondVar * fWriteWaitAck
 
XrdClientVector< ClientRequest > fWriteReqsToRetry
 
XrdClientUrlInfo * fMetaUrl
 
bool fLBSIsMeta
 

Static Private Attributes

static XrdOucString fgClientHostDomain
 
static XrdSysMutex fSessionIDRMutex
 
static XrdOucHash< SessionIDInfo > fSessionIDRepo
 
static XrdClientConnectionMgr * fgConnectionMgr
 

Member Enumeration Documentation

Enumerator
kSEHRReturnMsgToCaller 
kSEHRBreakLoop 
kSEHRContinue 
kSEHRReturnNoMsgToCaller 
kSEHRRedirLimitReached 
Enumerator
kTSRHReturnMex 
kTSRHReturnNullMex 
kTSRHContinue 

Constructor & Destructor Documentation

XrdClientConn::XrdClientConn ( )
virtual XrdClientConn::~XrdClientConn ( )
virtual

Member Function Documentation

bool XrdClientConn::CacheWillFit ( long long  bytes)
inline
bool XrdClientConn::CheckErrorStatus ( XrdClientMessage *  ,
short &  ,
char *   
)
private
bool XrdClientConn::CheckHostDomain ( XrdOucString  hostToCheck)
void XrdClientConn::CheckPort ( int &  port)
private
void XrdClientConn::CheckREQConnectWaitState ( )
private
void XrdClientConn::CheckREQPauseState ( )
private
bool XrdClientConn::CheckResp ( struct ServerResponseHeader *  resp,
const char *  method 
)
private
void XrdClientConn::ClearLastServerError ( )
inline
XrdClientMessage* XrdClientConn::ClientServerCmd ( ClientRequest *  req,
const void *  reqMoreData,
void **  answMoreDataAllocated,
void *  answMoreData,
bool  HasToAlloc,
int  substreamid = 0 
)
private
short XrdClientConn::Connect ( XrdClientUrlInfo  Host2Conn,
XrdClientAbsUnsolMsgHandler *  unsolhandler 
)
static void XrdClientConn::DelSessionIDRepo ( )
inlinestatic
void XrdClientConn::Disconnect ( bool  ForcePhysicalDisc)
XrdSecProtocol* XrdClientConn::DoAuthentication ( char *  plist,
int  plsiz 
)
private
ERemoteServerType XrdClientConn::DoHandShake ( short  log)
private
bool XrdClientConn::DoLogin ( )
private
bool XrdClientConn::DomainMatcher ( XrdOucString  dom,
XrdOucString  domlist 
)
private
bool XrdClientConn::DoWriteHardCheckPoint ( )
bool XrdClientConn::DoWriteSoftCheckPoint ( )
virtual bool XrdClientConn::GetAccessToSrv ( )
virtual
bool XrdClientConn::GetCacheInfo ( int &  size,
long long &  bytessubmitted,
long long &  byteshit,
long long &  misscount,
float &  missrate,
long long &  readreqcnt,
float &  bytesusefulness 
)
inline
XrdOucString XrdClientConn::GetClientHostDomain ( )
inline

References fgClientHostDomain.

static XrdClientConnectionMgr* XrdClientConn::GetConnectionMgr ( )
inlinestatic

References fgConnectionMgr.

XrdClientUrlInfo XrdClientConn::GetCurrentUrl ( )
inline

References fUrl.

long XrdClientConn::GetDataFromCache ( const void *  buffer,
long long  begin_offs,
long long  end_offs,
bool  PerfCalc,
XrdClientIntvList &  missingblks,
long &  outstandingblks 
)
XrdOucString XrdClientConn::GetDomainToMatch ( XrdOucString  hostname)
private
XrdClientUrlInfo* XrdClientConn::GetLBSUrl ( )
inline

References fLBSUrl.

int XrdClientConn::GetLogConnID ( ) const
inline

References fLogConnID.

short XrdClientConn::GetMaxRedirCnt ( ) const
inline

References fMaxGlobalRedirCnt.

XrdClientUrlInfo* XrdClientConn::GetMetaUrl ( )
inline

References fMetaUrl.

XErrorCode XrdClientConn::GetOpenError ( ) const
inline

References fOpenError.

int XrdClientConn::GetOpenSockFD ( ) const
inline

References fOpenSockFD.

int XrdClientConn::GetParallelStreamCount ( )
int XrdClientConn::GetParallelStreamToUse ( int  reqsperstream)
static XrdClientPhyConnection* XrdClientConn::GetPhyConn ( int  LogConnID)
static
short XrdClientConn::GetRedirCnt ( ) const
inline

References fGlobalRedirCnt.

XrdClientUrlInfo XrdClientConn::GetRedirUrl ( )
inline

References fREQUrl.

long XrdClientConn::GetServerProtocol ( )
inline

References fServerProto.

ERemoteServerType XrdClientConn::GetServerType ( ) const
inline

References fServerType.

void XrdClientConn::GetSessionID ( SessionIDInfo &  sess)
inline

References mySessionID.

kXR_unt16 XrdClientConn::GetStreamID ( ) const
inline

References fPrimaryStreamid.

XReqErrorType XrdClientConn::GoBackToRedirector ( )
virtual XReqErrorType XrdClientConn::GoToAnotherServer ( XrdClientUrlInfo &  newdest)
virtual
virtual XReqErrorType XrdClientConn::GoToMetaManager ( )
virtual
ESrvErrorHandlerRetval XrdClientConn::HandleServerError ( XReqErrorType &  ,
XrdClientMessage *  ,
ClientRequest *   
)
private
bool XrdClientConn::IsConnected ( ) const
inline

References fConnected.

bool XrdClientConn::IsOpTimeLimitElapsed ( time_t  timenow)
bool XrdClientConn::IsPhyConnConnected ( )
bool XrdClientConn::MatchStreamid ( struct ServerResponseHeader *  ServerResponse)
private
bool XrdClientConn::PanicClose ( )
private
XrdOucString XrdClientConn::ParseDomainFromHostname ( XrdOucString  hostname)
private
void XrdClientConn::PrintCache ( )
inline
UnsolRespProcResult XrdClientConn::ProcessAsynResp ( XrdClientMessage *  unsolmsg)
XrdClientMessage* XrdClientConn::ReadPartialAnswer ( XReqErrorType &  ,
size_t &  ,
ClientRequest *  ,
bool  ,
void **  ,
EThreeStateReadHandler &   
)
private
void XrdClientConn::RemoveAllDataFromCache ( bool  keepwriteblocks = true)
inline
void XrdClientConn::RemoveDataFromCache ( long long  begin_offs,
long long  end_offs,
bool  remove_overlapped = false 
)
inline
void XrdClientConn::RemovePlaceholdersFromCache ( )
inline
virtual bool XrdClientConn::SendGenCommand ( ClientRequest *  req,
const void *  reqMoreData,
void **  answMoreDataAllocated,
void *  answMoreData,
bool  HasToAlloc,
char *  CmdName,
int  substreamid = 0 
)
virtual
void XrdClientConn::SetCacheRmPolicy ( int  RmPolicy)
inline
void XrdClientConn::SetCacheSize ( int  CacheSize)
inline
void XrdClientConn::SetClientHostDomain ( const char *  src)
inline

References fgClientHostDomain.

void XrdClientConn::SetConnected ( bool  conn)
inline

References fConnected.

void XrdClientConn::SetLogConnID ( int  cid)
inlineprotected

References fLogConnID.

void XrdClientConn::SetMaxRedirCnt ( short  mx)
inline

References fMaxGlobalRedirCnt.

void XrdClientConn::SetOpenError ( XErrorCode  err)
inline

References fOpenError.

void XrdClientConn::SetOpTimeLimit ( int  delta_secs)
void XrdClientConn::SetRedirHandler ( XrdClientAbs *  rh)
inline

References fRedirHandler.

void XrdClientConn::SetREQDelayedConnectState ( kXR_int32  wsec)
inline
void XrdClientConn::SetREQPauseState ( kXR_int32  wsec)
inline
void XrdClientConn::SetRequestedDestHost ( char *  newh,
kXR_int32  port 
)
inline
void XrdClientConn::SetSID ( kXR_char *  sid)
void XrdClientConn::SetStreamID ( kXR_unt16  sid)
inlineprotected

References fPrimaryStreamid.

void XrdClientConn::SetUrl ( XrdClientUrlInfo  thisUrl)
inline

References fUrl.

bool XrdClientConn::SubmitDataToCache ( XrdClientMessage *  xmsg,
long long  begin_offs,
long long  end_offs 
)
void XrdClientConn::SubmitPlaceholderToCache ( long long  begin_offs,
long long  end_offs 
)
inline
bool XrdClientConn::SubmitRawDataToCache ( const void *  buffer,
long long  begin_offs,
long long  end_offs 
)
void XrdClientConn::UnPinCacheBlk ( long long  begin_offs,
long long  end_offs 
)
inline
void XrdClientConn::UnPinCacheBlk ( )
bool XrdClientConn::WaitResp ( int  secsmax)
private
XReqErrorType XrdClientConn::WriteToServer ( ClientRequest *  req,
const void *  reqMoreData,
short  LogConnID,
int  substreamid = 0 
)
private
XReqErrorType XrdClientConn::WriteToServer_Async ( ClientRequest *  req,
const void *  reqMoreData,
int  substreamid = 0 
)

Member Data Documentation

bool XrdClientConn::fConnected
private

Referenced by IsConnected(), and SetConnected().

XrdOucString XrdClientConn::fgClientHostDomain
staticprivate
XrdClientConnectionMgr* XrdClientConn::fgConnectionMgr
staticprivate

Referenced by GetConnectionMgr().

bool XrdClientConn::fGettingAccessToSrv
private
short XrdClientConn::fGlobalRedirCnt
protected

Referenced by GetRedirCnt().

time_t XrdClientConn::fGlobalRedirLastUpdateTimestamp
private
int XrdClientConn::fLastDataBytesRecv
int XrdClientConn::fLastDataBytesSent
bool XrdClientConn::fLBSIsMeta
private
XrdClientUrlInfo* XrdClientConn::fLBSUrl
protected

Referenced by GetLBSUrl().

int XrdClientConn::fLogConnID
private

Referenced by GetLogConnID(), and SetLogConnID().

XrdClientReadCache* XrdClientConn::fMainReadCache
private
short XrdClientConn::fMaxGlobalRedirCnt
private

Referenced by GetMaxRedirCnt(), and SetMaxRedirCnt().

XrdClientUrlInfo* XrdClientConn::fMetaUrl
private

Referenced by GetMetaUrl().

XErrorCode XrdClientConn::fOpenError

Referenced by GetOpenError(), and SetOpenError().

int XrdClientConn::fOpenSockFD
private

Referenced by GetOpenSockFD().

time_t XrdClientConn::fOpTimeLimit
private
kXR_unt16 XrdClientConn::fPrimaryStreamid
private

Referenced by GetStreamID(), and SetStreamID().

XrdOucString XrdClientConn::fRedirCGI
XrdClientAbs* XrdClientConn::fRedirHandler
private

Referenced by SetRedirHandler().

XrdOucString XrdClientConn::fRedirInternalToken
private
XrdOucString XrdClientConn::fRedirOpaque
XrdSysCondVar* XrdClientConn::fREQConnectWait
private
time_t XrdClientConn::fREQConnectWaitTimeLimit
private
XrdClientUrlInfo XrdClientConn::fREQUrl
protected
XrdSysCondVar* XrdClientConn::fREQWait
private

Referenced by SetREQPauseState().

XrdSysCondVar* XrdClientConn::fREQWaitResp
private
ServerResponseBody_Attn_asynresp* XrdClientConn::fREQWaitRespData
private
time_t XrdClientConn::fREQWaitTimeLimit
private

Referenced by SetREQPauseState().

long XrdClientConn::fServerProto
private

Referenced by GetServerProtocol().

ERemoteServerType XrdClientConn::fServerType
private

Referenced by GetServerType().

XrdOucHash<SessionIDInfo> XrdClientConn::fSessionIDRepo
staticprivate

Referenced by DelSessionIDRepo().

XrdSysMutex XrdClientConn::fSessionIDRMutex
staticprivate

Referenced by DelSessionIDRepo().

XrdClientAbsUnsolMsgHandler* XrdClientConn::fUnsolMsgHandler
protected
XrdClientUrlInfo XrdClientConn::fUrl
protected
XrdClientVector<ClientRequest> XrdClientConn::fWriteReqsToRetry
private
XrdSysCondVar* XrdClientConn::fWriteWaitAck
private

Referenced by UnPinCacheBlk().

struct ServerResponseBody_Error XrdClientConn::LastServerError

Referenced by ClearLastServerError().

struct ServerResponseHeader XrdClientConn::LastServerResp
SessionIDInfo XrdClientConn::mySessionID
private

Referenced by GetSessionID().


The documentation for this class was generated from the following file: