#include <XrdHttpProtocol.hh>
Classes | |
struct | StaticPreloadInfo |
Public Member Functions | |
XrdHttpProtocol (bool imhttps) | |
XrdHttpProtocol (const XrdHttpProtocol &)=default | |
Ctor, dtors and copy ctor. | |
~XrdHttpProtocol () | |
int | doChksum (const XrdOucString &fname) |
Perform a checksum request. | |
void | DoIt () |
Override from the base class. | |
int | doStat (char *fname) |
Perform a Stat request. | |
bool | isHTTPS () |
called via https | |
XrdProtocol * | Match (XrdLink *lp) |
Tells if the oustanding bytes on the socket match this protocol implementation. | |
XrdHttpProtocol | operator= (const XrdHttpProtocol &rhs) |
int | Process (XrdLink *lp) |
Process data incoming from the socket. | |
void | Recycle (XrdLink *lp, int consec, const char *reason) |
Recycle this instance. | |
int | Stats (char *buff, int blen, int do_sync=0) |
Get activity stats. | |
Public Member Functions inherited from XrdProtocol | |
XrdProtocol (const char *jname) | |
virtual | ~XrdProtocol () |
Public Member Functions inherited from XrdJob | |
XrdJob (const char *desc="") | |
virtual | ~XrdJob () |
Static Public Member Functions | |
static int | Configure (char *parms, XrdProtocol_Config *pi) |
Read and apply the configuration. | |
static int | parseHeader2CGI (XrdOucStream &Config, XrdSysError &err, std::map< std::string, std::string > &header2cgi) |
Use this function to parse header2cgi configurations. |
Public Attributes | |
XrdObject< XrdHttpProtocol > | ProtLink |
XrdSecEntity | SecEntity |
Authentication area. | |
Public Attributes inherited from XrdJob | |
const char * | Comment |
XrdJob * | NextJob |
Static Public Attributes | |
static XrdHttpChecksumHandler | cksumHandler = XrdHttpChecksumHandler() |
static XrdObjectQ< XrdHttpProtocol > | ProtStack |
static XrdHttpReadRangeHandler::Configuration | ReadRangeConfig |
configuration for the read range handler |
Protected Attributes | |
char * | Addr_str |
XrdXrootd::Bridge * | Bridge |
The Bridge that we use to exercise the xrootd internals. | |
XrdHttpReq | CurrentReq |
XrdLink * | Link |
The link we are bound to. |
Static Protected Attributes | |
static XrdBuffManager * | BPool = 0 |
static XrdSecService * | CIA = 0 |
static bool | compatNameGeneration = false |
static int | crlRefIntervalSec = XrdTlsContext::DEFAULT_CRL_REF_INT_SEC |
CRL thread refresh interval. | |
static XrdSysError | eDest = 0 |
static bool | embeddedstatic = true |
If true, use the embedded css and icons. | |
static char * | gridmap = 0 |
Gridmap file location. The same used by XrdSecGsi. | |
static int | hailWait = 60000 |
Timeout for reading the handshake. | |
static std::map< std::string, std::string > | hdr2cgimap |
Rules that turn HTTP headers to cgi tokens in the URL, for internal comsumption. | |
static bool | isdesthttps = false |
True if the redirections must be towards https targets. | |
static bool | isRequiredGridmap = false |
static bool | listdeny = false |
If true, any form of listing is denied. | |
static char * | listredir = 0 |
Url to redirect to in the case a listing is requested. | |
static BIO_METHOD * | m_bio_method = NULL |
C-style vptr table for our custom BIO objects. | |
static int | m_bio_type = 0 |
Type identifier for our custom BIO objects. | |
static kXR_int32 | myRole = kXR_isManager |
Our role. | |
static XrdNetPMark * | pmarkHandle = nullptr |
Packet marking handler pointer (assigned from the environment during the Config() call) | |
static int | Port = 1094 |
Our port. | |
static char * | Port_str = 0 |
Our port, as a string. | |
static int | readWait = 300000 |
Timeout for reading data. | |
static XrdScheduler * | Sched = 0 |
static char * | secretkey = 0 |
The key used to calculate the url hashes. | |
static bool | selfhttps2http = false |
If client is HTTPS, self-redirect with HTTP+token. | |
static XrdOucGMap * | servGMap = 0 |
The instance of the DN mapper. Created only when a valid path is given. | |
static char * | sslcadir = 0 |
static char * | sslcafile = 0 |
static char * | sslcert = 0 |
OpenSSL stuff. | |
static char * | sslcipherfilter = 0 |
static char * | sslkey = 0 |
static int | sslverifydepth = 9 |
Depth of verification of a certificate chain. | |
static XrdOucHash< StaticPreloadInfo > * | staticpreload = 0 |
static char * | staticredir = 0 |
static bool | tpcForwardCreds = false |
If set to true, the HTTP TPC transfers will forward the credentials to redirected hosts. | |
static char * | xrd_cslist = nullptr |
The list of checksums that were configured via the xrd.cksum parameter on the server config file. |
Friends | |
class | XrdHttpExtReq |
class | XrdHttpReq |
Definition at line 79 of file XrdHttpProtocol.hh.
struct XrdHttpProtocol::StaticPreloadInfo |
Definition at line 427 of file XrdHttpProtocol.hh.
Class Members | ||
---|---|---|
char * | data | |
int | len |
|
default |
Ctor, dtors and copy ctor.
References XrdHttpProtocol().
Referenced by XrdHttpProtocol(), Match(), and operator=().
XrdHttpProtocol::XrdHttpProtocol | ( | bool | imhttps | ) |
Definition at line 192 of file XrdHttpProtocol.cc.
References XrdProtocol::XrdProtocol(), Addr_str, CurrentReq, ProtLink, ReadRangeConfig, and SecEntity.
|
inline |
Definition at line 123 of file XrdHttpProtocol.hh.
|
static |
Read and apply the configuration.
Definition at line 1695 of file XrdHttpProtocol.cc.
References BPool, XrdProtocol_Config::BPool, XrdProtocol_Config::ConfigFN, XrdProtocol_Config::ConnMax, XrdProtocol_Config::DebugON, eDest, XrdProtocol_Config::eDest, kXR_isManager, kXR_isServer, XrdSysError::logger(), myRole, Port, XrdProtocol_Config::Port, Port_str, ProtStack, Sched, XrdProtocol_Config::Sched, XrdProtocol_Config::theEnv, XrdProtocol_Config::tlsCtx, TRACE_ALL, TRACE_MEM, xrd_cslist, XrdHttpProtoInfo::xrdctx, and XrdHttpTrace.
Referenced by XrdgetProtocol().
int XrdHttpProtocol::doChksum | ( | const XrdOucString & | fname | ) |
Perform a checksum request.
Definition at line 2952 of file XrdHttpProtocol.cc.
References Bridge, XrdOucString::c_str(), CurrentReq, kXR_Qcksum, kXR_query, and XrdOucString::length().
|
inlinevirtual |
Override from the base class.
Implements XrdJob.
Definition at line 90 of file XrdHttpProtocol.hh.
int XrdHttpProtocol::doStat | ( | char * | fname | ) |
Perform a Stat request.
Definition at line 2924 of file XrdHttpProtocol.cc.
References Bridge, CurrentReq, and kXR_stat.
|
inline |
|
virtual |
Tells if the oustanding bytes on the socket match this protocol implementation.
Implements XrdProtocol.
Definition at line 218 of file XrdHttpProtocol.cc.
References XrdHttpProtocol(), XrdProtocol::XrdProtocol(), XrdLink::AddrInfo(), XrdSecEntity::addrInfo, BPool, XrdBuffer::buff, DEBUG, hailWait, XrdHttpProtoInfo::httpsmode, Link, XrdLink::NetAddr(), XrdLink::Peek(), ProtStack, SecEntity, XrdNetAddr::SetDialect(), XrdLink::setEtext(), XrdNetAddr::SetTLS(), and TRACEI.
XrdHttpProtocol XrdHttpProtocol::operator= | ( | const XrdHttpProtocol & | rhs | ) |
Definition at line 207 of file XrdHttpProtocol.cc.
References XrdHttpProtocol().
|
static |
Use this function to parse header2cgi configurations.
Definition at line 1765 of file XrdHttpProtocol.cc.
References XrdSysError::Emsg().
|
virtual |
Process data incoming from the socket.
Implements XrdProtocol.
Definition at line 480 of file XrdHttpProtocol.cc.
References Addr_str, Bridge, XrdOucString::c_str(), calcHashes(), compareHash(), CurrentReq, DEBUG, eDest, kXR_set, Link, XrdXrootd::Bridge::Login(), obfuscateAuth(), Port_str, XrdHttpReq::rtGET, XrdHttpReq::rtPROPFIND, XrdHttpReq::rtPUT, SecEntity, secretkey, selfhttps2http, sslcadir, TRACE, TRACE_AUTH, TRACE_DEBUG, TRACEI, TRACING, unquote(), XrdHttpProtoInfo::xrdctx, and XRHTTP_TK_GRACETIME.
|
virtual |
Recycle this instance.
Implements XrdProtocol.
Definition at line 920 of file XrdHttpProtocol.cc.
|
virtual |
Get activity stats.
Implements XrdProtocol.
Definition at line 937 of file XrdHttpProtocol.cc.
|
friend |
Definition at line 82 of file XrdHttpProtocol.hh.
References XrdHttpExtReq.
Referenced by XrdHttpExtReq.
|
friend |
|
protected |
Our IP address, as a string. Please remember that this may not be unique for a given machine, hence we need to keep it here and recompute ad every new connection.
Definition at line 361 of file XrdHttpProtocol.hh.
Referenced by XrdHttpProtocol(), and Process().
|
staticprotected |
Definition at line 352 of file XrdHttpProtocol.hh.
Referenced by Configure(), and Match().
|
protected |
The Bridge that we use to exercise the xrootd internals.
Definition at line 367 of file XrdHttpProtocol.hh.
Referenced by doChksum(), doStat(), and Process().
|
staticprotected |
Definition at line 354 of file XrdHttpProtocol.hh.
|
static |
Definition at line 135 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 400 of file XrdHttpProtocol.hh.
|
staticprotected |
CRL thread refresh interval.
Definition at line 395 of file XrdHttpProtocol.hh.
|
protected |
Area for coordinating request and responses to/from the bridge This also can process HTTP/DAV stuff
Definition at line 372 of file XrdHttpProtocol.hh.
Referenced by XrdHttpProtocol(), doChksum(), doStat(), and Process().
|
staticprotected |
Definition at line 353 of file XrdHttpProtocol.hh.
Referenced by Configure(), and Process().
|
staticprotected |
If true, use the embedded css and icons.
Definition at line 421 of file XrdHttpProtocol.hh.
|
staticprotected |
Gridmap file location. The same used by XrdSecGsi.
Definition at line 398 of file XrdHttpProtocol.hh.
|
staticprotected |
Timeout for reading the handshake.
Definition at line 380 of file XrdHttpProtocol.hh.
Referenced by Match().
|
staticprotected |
Rules that turn HTTP headers to cgi tokens in the URL, for internal comsumption.
Definition at line 437 of file XrdHttpProtocol.hh.
|
staticprotected |
True if the redirections must be towards https targets.
Definition at line 409 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 399 of file XrdHttpProtocol.hh.
|
protected |
The link we are bound to.
Definition at line 357 of file XrdHttpProtocol.hh.
|
staticprotected |
If true, any form of listing is denied.
Definition at line 415 of file XrdHttpProtocol.hh.
|
staticprotected |
Url to redirect to in the case a listing is requested.
Definition at line 412 of file XrdHttpProtocol.hh.
|
staticprotected |
C-style vptr table for our custom BIO objects.
Definition at line 443 of file XrdHttpProtocol.hh.
|
staticprotected |
Type identifier for our custom BIO objects.
Definition at line 440 of file XrdHttpProtocol.hh.
|
staticprotected |
|
staticprotected |
Packet marking handler pointer (assigned from the environment during the Config() call)
Definition at line 449 of file XrdHttpProtocol.hh.
|
staticprotected |
|
staticprotected |
Our port, as a string.
Definition at line 389 of file XrdHttpProtocol.hh.
Referenced by Configure(), and Process().
XrdObject<XrdHttpProtocol> XrdHttpProtocol::ProtLink |
Definition at line 128 of file XrdHttpProtocol.hh.
Referenced by XrdHttpProtocol(), and Recycle().
|
static |
Definition at line 127 of file XrdHttpProtocol.hh.
Referenced by Configure(), Match(), and Recycle().
|
static |
configuration for the read range handler
Definition at line 138 of file XrdHttpProtocol.hh.
Referenced by XrdHttpProtocol().
|
staticprotected |
Timeout for reading data.
Definition at line 383 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 351 of file XrdHttpProtocol.hh.
Referenced by Configure().
XrdSecEntity XrdHttpProtocol::SecEntity |
Authentication area.
Definition at line 132 of file XrdHttpProtocol.hh.
Referenced by XrdHttpProtocol(), Match(), and Process().
|
staticprotected |
The key used to calculate the url hashes.
Definition at line 403 of file XrdHttpProtocol.hh.
Referenced by Process().
|
staticprotected |
If client is HTTPS, self-redirect with HTTP+token.
Definition at line 418 of file XrdHttpProtocol.hh.
Referenced by Process().
|
staticprotected |
The instance of the DN mapper. Created only when a valid path is given.
Definition at line 364 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 392 of file XrdHttpProtocol.hh.
Referenced by Process().
|
staticprotected |
Definition at line 392 of file XrdHttpProtocol.hh.
|
staticprotected |
OpenSSL stuff.
Definition at line 392 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 392 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 392 of file XrdHttpProtocol.hh.
|
staticprotected |
Depth of verification of a certificate chain.
Definition at line 406 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 431 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 424 of file XrdHttpProtocol.hh.
|
staticprotected |
If set to true, the HTTP TPC transfers will forward the credentials to redirected hosts.
Definition at line 452 of file XrdHttpProtocol.hh.
|
staticprotected |
The list of checksums that were configured via the xrd.cksum parameter on the server config file.
Definition at line 446 of file XrdHttpProtocol.hh.
Referenced by Configure().