Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XrdCl] Refactor TPC fall-back logic.
- Loading branch information
1 parent
0d7c2a3
commit cc7ec36
Showing
5 changed files
with
350 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* XrdClDlgEnv.hh | ||
* | ||
* Created on: Oct 17, 2018 | ||
* Author: simonm | ||
*/ | ||
|
||
#ifndef SRC_XRDCL_XRDCLDLGENV_HH_ | ||
#define SRC_XRDCL_XRDCLDLGENV_HH_ | ||
|
||
#include <stdlib.h> | ||
|
||
|
||
namespace XrdCl | ||
{ | ||
|
||
//---------------------------------------------------------------------------- | ||
//! Helper class for setting and unsetting the 'XrdSecGSIDELEGPROXY' | ||
//! environment variable. | ||
//---------------------------------------------------------------------------- | ||
class DlgEnv | ||
{ | ||
public: | ||
|
||
//------------------------------------------------------------------------ | ||
//! @return : instance of DlgEnv | ||
//------------------------------------------------------------------------ | ||
static DlgEnv& Instance() | ||
{ | ||
static DlgEnv instance; | ||
return instance; | ||
} | ||
|
||
//------------------------------------------------------------------------ | ||
//! Destructor | ||
//! | ||
//! Release the memory used to set environment | ||
//------------------------------------------------------------------------ | ||
~DlgEnv() | ||
{ | ||
unsetenv( "XrdSecGSIDELEGPROXY" ); | ||
} | ||
|
||
//------------------------------------------------------------------------ | ||
//! Enable delegation in the environment | ||
//------------------------------------------------------------------------ | ||
void Enable() | ||
{ | ||
setenv( "XrdSecGSIDELEGPROXY", "1", 1 ); | ||
} | ||
|
||
//------------------------------------------------------------------------ | ||
//! Disable delegation in the environment | ||
//------------------------------------------------------------------------ | ||
void Disable() | ||
{ | ||
setenv( "XrdSecGSIDELEGPROXY", "0", 1 ); | ||
} | ||
|
||
private: | ||
|
||
//------------------------------------------------------------------------ | ||
//! Default constructor | ||
//------------------------------------------------------------------------ | ||
DlgEnv() { } | ||
|
||
//------------------------------------------------------------------------ | ||
//! Copy constructor - deleted | ||
//------------------------------------------------------------------------ | ||
DlgEnv( const DlgEnv& ); | ||
|
||
//------------------------------------------------------------------------ | ||
//! Assigment operator - deleted | ||
//------------------------------------------------------------------------ | ||
DlgEnv& operator=( const DlgEnv& ); | ||
}; | ||
|
||
} | ||
|
||
#endif /* SRC_XRDCL_XRDCLDLGENV_HH_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.