![]() |
XRootD
|
#include <XrdHttpProtocol.hh>
Classes | |
struct | StaticPreloadInfo |
Public Member Functions | |
XrdHttpProtocol (bool imhttps) | |
XrdHttpProtocol (const XrdHttpProtocol &)=default | |
Ctor, dtors and copy ctor. More... | |
~XrdHttpProtocol () | |
int | doChksum (const XrdOucString &fname) |
Perform a checksum request. More... | |
void | DoIt () |
Override from the base class. More... | |
int | doStat (char *fname) |
Perform a Stat request. More... | |
bool | isHTTPS () |
called via https More... | |
XrdProtocol * | Match (XrdLink *lp) |
Tells if the oustanding bytes on the socket match this protocol implementation. More... | |
XrdHttpProtocol | operator= (const XrdHttpProtocol &rhs) |
int | Process (XrdLink *lp) |
Process data incoming from the socket. More... | |
void | Recycle (XrdLink *lp, int consec, const char *reason) |
Recycle this instance. More... | |
int | Stats (char *buff, int blen, int do_sync=0) |
Get activity stats. More... | |
![]() | |
XrdProtocol (const char *jname) | |
virtual | ~XrdProtocol () |
![]() | |
XrdJob (const char *desc="") | |
virtual | ~XrdJob () |
Static Public Member Functions | |
static int | Configure (char *parms, XrdProtocol_Config *pi) |
Read and apply the configuration. More... | |
static int | parseHeader2CGI (XrdOucStream &Config, XrdSysError &err, std::map< std::string, std::string > &header2cgi) |
Use this function to parse header2cgi configurations. More... | |
Public Attributes | |
XrdObject< XrdHttpProtocol > | ProtLink |
XrdSecEntity | SecEntity |
Authentication area. More... | |
![]() | |
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 More... | |
Protected Attributes | |
char * | Addr_str |
XrdXrootd::Bridge * | Bridge |
The Bridge that we use to exercise the xrootd internals. More... | |
XrdHttpReq | CurrentReq |
XrdLink * | Link |
The link we are bound to. More... | |
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. More... | |
static XrdSysError | eDest = 0 |
static bool | embeddedstatic = true |
If true, use the embedded css and icons. More... | |
static char * | gridmap = 0 |
Gridmap file location. The same used by XrdSecGsi. More... | |
static int | hailWait = 60000 |
Timeout for reading the handshake. More... | |
static std::map< std::string, std::string > | hdr2cgimap |
Rules that turn HTTP headers to cgi tokens in the URL, for internal comsumption. More... | |
static bool | isdesthttps = false |
True if the redirections must be towards https targets. More... | |
static bool | isRequiredGridmap = false |
static bool | listdeny = false |
If true, any form of listing is denied. More... | |
static char * | listredir = 0 |
Url to redirect to in the case a listing is requested. More... | |
static BIO_METHOD * | m_bio_method = NULL |
C-style vptr table for our custom BIO objects. More... | |
static int | m_bio_type = 0 |
Type identifier for our custom BIO objects. More... | |
static std::unordered_map< std::string, std::vector< std::pair< std::string, std::string > > > | m_staticheader_map |
The static headers to always return; map is from verb to a list of (header, val) pairs. More... | |
static std::unordered_map< std::string, std::string > | m_staticheaders |
static kXR_int32 | myRole = kXR_isManager |
Our role. More... | |
static XrdNetPMark * | pmarkHandle = nullptr |
Packet marking handler pointer (assigned from the environment during the Config() call) More... | |
static int | Port = 1094 |
Our port. More... | |
static char * | Port_str = 0 |
Our port, as a string. More... | |
static int | readWait = 300000 |
Timeout for reading data. More... | |
static XrdScheduler * | Sched = 0 |
static char * | secretkey = 0 |
The key used to calculate the url hashes. More... | |
static bool | selfhttps2http = false |
If client is HTTPS, self-redirect with HTTP+token. More... | |
static XrdOucGMap * | servGMap = 0 |
The instance of the DN mapper. Created only when a valid path is given. More... | |
static char * | sslcadir = 0 |
static char * | sslcafile = 0 |
static char * | sslcert = 0 |
OpenSSL stuff. More... | |
static char * | sslcipherfilter = 0 |
static char * | sslkey = 0 |
static int | sslverifydepth = 9 |
Depth of verification of a certificate chain. More... | |
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. More... | |
static char * | xrd_cslist = nullptr |
The list of checksums that were configured via the xrd.cksum parameter on the server config file. More... | |
Friends | |
class | XrdHttpExtReq |
class | XrdHttpReq |
Definition at line 80 of file XrdHttpProtocol.hh.
struct XrdHttpProtocol::StaticPreloadInfo |
Definition at line 430 of file XrdHttpProtocol.hh.
Class Members | ||
---|---|---|
char * | data | |
int | len |
|
default |
XrdHttpProtocol::XrdHttpProtocol | ( | bool | imhttps | ) |
Definition at line 196 of file XrdHttpProtocol.cc.
References Addr_str.
|
inline |
Definition at line 124 of file XrdHttpProtocol.hh.
|
static |
Read and apply the configuration.
Definition at line 1728 of file XrdHttpProtocol.cc.
References XrdProtocol_Config::BPool, BPool, XrdCms::Config, XrdProtocol_Config::ConfigFN, XrdProtocol_Config::ConnMax, XrdProtocol_Config::DebugON, XrdProtocol_Config::eDest, eDest, XrdSysError::Emsg(), kXR_isManager, kXR_isServer, XrdSysError::logger(), myRole, XrdProtocol_Config::Port, Port, Port_str, ProtStack, XrdProtocol_Config::Sched, Sched, XrdObjectQ< T >::Set(), XrdSysTrace::SetLogger(), XrdProtocol_Config::theEnv, XrdProtocol_Config::tlsCtx, TRACE_ALL, TRACE_MEM, XrdSysTrace::What, xrd_cslist, XrdHttpProtoInfo::xrdctx, and XrdHttpTrace.
Referenced by XrdgetProtocol().
int XrdHttpProtocol::doChksum | ( | const XrdOucString & | fname | ) |
Perform a checksum request.
Definition at line 3068 of file XrdHttpProtocol.cc.
References Bridge, XrdOucString::c_str(), CurrentReq, ClientQueryRequest::dlen, ClientQueryRequest::fhandle, ClientQueryRequest::infotype, kXR_Qcksum, kXR_query, XrdOucString::length(), ClientRequest::query, ClientQueryRequest::requestid, ClientQueryRequest::reserved1, ClientQueryRequest::reserved2, XrdXrootd::Bridge::Run(), and XrdHttpReq::xrdreq.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
inlinevirtual |
int XrdHttpProtocol::doStat | ( | char * | fname | ) |
Perform a Stat request.
Definition at line 3040 of file XrdHttpProtocol.cc.
References Bridge, CurrentReq, ClientStatRequest::dlen, XrdHttpReq::fileflags, XrdHttpReq::filemodtime, XrdHttpReq::filesize, kXR_stat, ClientStatRequest::requestid, ClientStatRequest::reserved, XrdXrootd::Bridge::Run(), ClientRequest::stat, and XrdHttpReq::xrdreq.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
inline |
called via https
Definition at line 142 of file XrdHttpProtocol.hh.
Referenced by XrdHttpExtReq::XrdHttpExtReq().
|
virtual |
Tells if the oustanding bytes on the socket match this protocol implementation.
Implements XrdProtocol.
Definition at line 222 of file XrdHttpProtocol.cc.
References XrdHttpProtocol(), XrdLink::AddrInfo(), XrdSecEntity::addrInfo, BPool, XrdBuffer::buff, DEBUG, hailWait, XrdHttpProtoInfo::httpsmode, Link, XrdLink::NetAddr(), XrdBuffManager::Obtain(), XrdLink::Peek(), XrdObjectQ< T >::Pop(), ProtStack, SecEntity, XrdNetAddr::SetDialect(), XrdLink::setEtext(), XrdNetAddr::SetTLS(), and TRACEI.
XrdHttpProtocol XrdHttpProtocol::operator= | ( | const XrdHttpProtocol & | rhs | ) |
Definition at line 211 of file XrdHttpProtocol.cc.
|
static |
Use this function to parse header2cgi configurations.
Definition at line 1798 of file XrdHttpProtocol.cc.
References XrdCms::Config, and XrdSysError::Emsg().
|
virtual |
Process data incoming from the socket.
Implements XrdProtocol.
Definition at line 484 of file XrdHttpProtocol.cc.
References Addr_str, XrdLink::AddrInfo(), XrdHttpReq::appendOpaque(), Bridge, XrdBuffer::bsize, XrdBuffer::buff, XrdOucString::c_str(), calcHashes(), compareHash(), XrdSecEntity::creds, XrdSecEntity::credslen, CurrentReq, DEBUG, XrdSecEntity::Display(), ClientSetRequest::dlen, eDest, XrdSecEntity::endorsements, XrdLink::FDnum(), XrdOucEnv::Get(), XrdSecEntity::grps, XrdHttpReq::headerok, XrdSecEntity::host, XrdHttpSecXtractor::InitSSL(), kXR_set, XrdOucString::length(), Link, XrdXrootd::Bridge::Login(), ClientSetRequest::modifier, XrdSecEntity::moninfo, XrdSecEntity::name, obfuscateAuth(), XrdHttpReq::opaque, XrdHttpReq::parseFirstLine(), XrdHttpReq::parseLine(), Port_str, XrdHttpReq::ProcessHTTPReq(), XrdSecEntity::prot, XrdHttpReq::reqstate, XrdHttpReq::request, ClientSetRequest::requestid, ClientSetRequest::reserved, XrdHttpReq::reset(), XrdHttpReq::resource, XrdSecEntity::role, XrdHttpReq::rtGET, XrdHttpReq::rtPROPFIND, XrdHttpReq::rtPUT, XrdHttpReq::rtUnset, XrdXrootd::Bridge::Run(), SecEntity, secretkey, selfhttps2http, XrdTlsContext::Session(), ClientRequest::set, XrdTlsContext::SetTlsClientAuth(), XrdNetAddrInfo::SockFD(), sslcadir, XrdHttpProtoInfo::tlsClientAuth, TRACE, TRACE_AUTH, TRACE_DEBUG, TRACEI, TRACING, unquote(), XrdHttpReq::userAgent(), XrdSecEntity::vorg, XrdHttpProtoInfo::xrdctx, XrdHttpReq::xrdreq, and XRHTTP_TK_GRACETIME.
|
virtual |
Recycle this instance.
Implements XrdProtocol.
Definition at line 928 of file XrdHttpProtocol.cc.
References ProtLink, ProtStack, and XrdObjectQ< T >::Push().
|
virtual |
|
friend |
Definition at line 83 of file XrdHttpProtocol.hh.
|
friend |
Definition at line 82 of file XrdHttpProtocol.hh.
|
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 364 of file XrdHttpProtocol.hh.
Referenced by XrdHttpProtocol(), and Process().
|
staticprotected |
Definition at line 355 of file XrdHttpProtocol.hh.
Referenced by Configure(), and Match().
|
protected |
The Bridge that we use to exercise the xrootd internals.
Definition at line 370 of file XrdHttpProtocol.hh.
Referenced by doChksum(), doStat(), Process(), and XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Definition at line 357 of file XrdHttpProtocol.hh.
|
static |
Definition at line 136 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Definition at line 403 of file XrdHttpProtocol.hh.
|
staticprotected |
CRL thread refresh interval.
Definition at line 398 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 375 of file XrdHttpProtocol.hh.
Referenced by doChksum(), doStat(), and Process().
|
staticprotected |
Definition at line 356 of file XrdHttpProtocol.hh.
Referenced by Configure(), and Process().
|
staticprotected |
If true, use the embedded css and icons.
Definition at line 424 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Gridmap file location. The same used by XrdSecGsi.
Definition at line 401 of file XrdHttpProtocol.hh.
|
staticprotected |
Timeout for reading the handshake.
Definition at line 383 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 440 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::parseLine().
|
staticprotected |
True if the redirections must be towards https targets.
Definition at line 412 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::Redir().
|
staticprotected |
Definition at line 402 of file XrdHttpProtocol.hh.
|
protected |
The link we are bound to.
Definition at line 360 of file XrdHttpProtocol.hh.
Referenced by XrdHttpExtReq::GetClientID(), Match(), and Process().
|
staticprotected |
If true, any form of listing is denied.
Definition at line 418 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Url to redirect to in the case a listing is requested.
Definition at line 415 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
C-style vptr table for our custom BIO objects.
Definition at line 446 of file XrdHttpProtocol.hh.
|
staticprotected |
Type identifier for our custom BIO objects.
Definition at line 443 of file XrdHttpProtocol.hh.
|
staticprotected |
The static headers to always return; map is from verb to a list of (header, val) pairs.
Definition at line 458 of file XrdHttpProtocol.hh.
|
staticprotected |
The static string version of m_staticheader_map. After config parsing is done, this is computed and we won't need to reference m_staticheader_map in the response path.
Definition at line 462 of file XrdHttpProtocol.hh.
|
staticprotected |
Our role.
Definition at line 437 of file XrdHttpProtocol.hh.
Referenced by Configure(), and XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Packet marking handler pointer (assigned from the environment during the Config() call)
Definition at line 452 of file XrdHttpProtocol.hh.
Referenced by XrdHttpExtReq::XrdHttpExtReq(), and XrdHttpReq::parseLine().
|
staticprotected |
|
staticprotected |
Our port, as a string.
Definition at line 392 of file XrdHttpProtocol.hh.
Referenced by Configure(), and Process().
XrdObject<XrdHttpProtocol> XrdHttpProtocol::ProtLink |
Definition at line 129 of file XrdHttpProtocol.hh.
Referenced by Recycle().
|
static |
Definition at line 128 of file XrdHttpProtocol.hh.
Referenced by Configure(), Match(), and Recycle().
|
static |
configuration for the read range handler
Definition at line 139 of file XrdHttpProtocol.hh.
|
staticprotected |
Timeout for reading data.
Definition at line 386 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 354 of file XrdHttpProtocol.hh.
Referenced by Configure().
XrdSecEntity XrdHttpProtocol::SecEntity |
Authentication area.
Definition at line 133 of file XrdHttpProtocol.hh.
Referenced by XrdHttpExtReq::XrdHttpExtReq(), XrdHttpExtReq::GetSecEntity(), Match(), Process(), and XrdHttpReq::Redir().
|
staticprotected |
The key used to calculate the url hashes.
Definition at line 406 of file XrdHttpProtocol.hh.
Referenced by Process(), and XrdHttpReq::Redir().
|
staticprotected |
If client is HTTPS, self-redirect with HTTP+token.
Definition at line 421 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 367 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 395 of file XrdHttpProtocol.hh.
Referenced by Process().
|
staticprotected |
Definition at line 395 of file XrdHttpProtocol.hh.
|
staticprotected |
OpenSSL stuff.
Definition at line 395 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 395 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 395 of file XrdHttpProtocol.hh.
|
staticprotected |
Depth of verification of a certificate chain.
Definition at line 409 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 434 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Definition at line 427 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
If set to true, the HTTP TPC transfers will forward the credentials to redirected hosts.
Definition at line 455 of file XrdHttpProtocol.hh.
Referenced by XrdHttpExtReq::XrdHttpExtReq().
|
staticprotected |
The list of checksums that were configured via the xrd.cksum parameter on the server config file.
Definition at line 449 of file XrdHttpProtocol.hh.
Referenced by Configure().