Skip to content

Commit

Permalink
[XrdCl] Make the debug level for TLS component configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed Jun 18, 2020
1 parent 4e0994e commit 4d34764
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/man/xrdcp.1
Expand Up @@ -317,6 +317,13 @@ Available topics: AppMsg, UtilityMsg, FileMsg, PollerMsg, PostMasterMsg,
XRootDTransportMsg, TaskMgrMsg, XRootDMsg, FileSystemMsg, AsyncSockMsg
.RE

XRD_TLSDBGLVL
.RS 5
Determine the debug level for the TLS component. Valid values are:
\fIOFF\fR, \fICTX\fR, \fISOK\fR, \fISIO\fR, \fIALL\fR and \fIOUT\fR.
The default value is \fIOFF\fR.
.RE

XRD_PARALLELEVTLOOP
.RS 5
The number of event loops.
Expand Down
1 change: 1 addition & 0 deletions src/XrdCl/XrdClConstants.hh
Expand Up @@ -96,6 +96,7 @@ namespace XrdCl
const char * const DefaultWriteRecovery = "true";
const char * const DefaultOpenRecovery = "true";
const char * const DefaultGlfnRedirector = "";
const char * const DefaultTlsDbgLvl = "OFF";
}

#endif // __XRD_CL_CONSTANTS_HH__
1 change: 1 addition & 0 deletions src/XrdCl/XrdClDefaultEnv.cc
Expand Up @@ -307,6 +307,7 @@ namespace XrdCl
REGISTER_VAR_STR( varsStr, "WriteRecovery", DefaultWriteRecovery );
REGISTER_VAR_STR( varsStr, "OpenRecovery", DefaultOpenRecovery );
REGISTER_VAR_STR( varsStr, "GlfnRedirector", DefaultGlfnRedirector );
REGISTER_VAR_STR( varsStr, "TlsDbgLvl", DefaultTlsDbgLvl );

//--------------------------------------------------------------------------
// Process the configuration files
Expand Down
21 changes: 20 additions & 1 deletion src/XrdCl/XrdClTls.cc
Expand Up @@ -63,7 +63,26 @@ namespace
inline SetTlsMsgCB()
{
XrdTls::SetMsgCB( MsgCallBack );
XrdTls::SetDebug( XrdTls::dbgALL, MsgCallBack );
XrdTls::SetDebug( TlsDbgLvl(), MsgCallBack );
}

//--------------------------------------------------------------------
// Get TLS debug level
//--------------------------------------------------------------------
static int TlsDbgLvl()
{
XrdCl::Env *env = XrdCl::DefaultEnv::GetEnv();
std::string tlsDbgLvl;
env->GetString( "TlsDbgLvl", tlsDbgLvl );

if( tlsDbgLvl == "OFF" ) return XrdTls::dbgOFF;
if( tlsDbgLvl == "CTX" ) return XrdTls::dbgCTX;
if( tlsDbgLvl == "SOK" ) return XrdTls::dbgSOK;
if( tlsDbgLvl == "SIO" ) return XrdTls::dbgSIO;
if( tlsDbgLvl == "ALL" ) return XrdTls::dbgALL;
if( tlsDbgLvl == "OUT" ) return XrdTls::dbgOUT;

return XrdTls::dbgOFF;
}
};

Expand Down

0 comments on commit 4d34764

Please sign in to comment.