|
XRootD
|
#include <XrdHttpProtocol.hh>
Inheritance diagram for XrdHttpProtocol:
Collaboration diagram for XrdHttpProtocol: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... | |
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. 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... | |
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 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 int | m_maxdelay = -1 |
| 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... | |
| static XrdHttpCors * | xrdcors = nullptr |
| static std::string | xrdcorsLibPath |
Friends | |
| class | XrdHttpExtReq |
| class | XrdHttpReq |
Definition at line 81 of file XrdHttpProtocol.hh.
| struct XrdHttpProtocol::StaticPreloadInfo |
Definition at line 441 of file XrdHttpProtocol.hh.
Collaboration diagram for XrdHttpProtocol::StaticPreloadInfo:| Class Members | ||
|---|---|---|
| char * | data | |
| int | len | |
|
default |
| XrdHttpProtocol::XrdHttpProtocol | ( | bool | imhttps | ) |
Definition at line 203 of file XrdHttpProtocol.cc.
References Addr_str.
|
inline |
Definition at line 125 of file XrdHttpProtocol.hh.
|
static |
Read and apply the configuration.
Definition at line 1752 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().
Here is the call graph for this function:
Here is the caller graph for this function:| int XrdHttpProtocol::doChksum | ( | const XrdOucString & | fname | ) |
Perform a checksum request.
Definition at line 3124 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().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinevirtual |
| int XrdHttpProtocol::doStat | ( | char * | fname | ) |
Perform a Stat request.
Definition at line 3096 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().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
called via https
Definition at line 143 of file XrdHttpProtocol.hh.
Referenced by XrdHttpExtReq::XrdHttpExtReq().
Here is the caller graph for this function:
|
virtual |
Tells if the oustanding bytes on the socket match this protocol implementation.
Implements XrdProtocol.
Definition at line 229 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.
Here is the call graph for this function:| XrdHttpProtocol XrdHttpProtocol::operator= | ( | const XrdHttpProtocol & | rhs | ) |
Definition at line 218 of file XrdHttpProtocol.cc.
|
static |
Use this function to parse header2cgi configurations.
Definition at line 1822 of file XrdHttpProtocol.cc.
References XrdCms::Config, and XrdSysError::Emsg().
Here is the call graph for this function:
|
virtual |
Process data incoming from the socket.
Implements XrdProtocol.
Definition at line 491 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, decode_str(), 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(), m_maxdelay, 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, XrdXrootd::Bridge::SetWait(), XrdNetAddrInfo::SockFD(), sslcadir, XrdHttpProtoInfo::tlsClientAuth, TRACE, TRACE_AUTH, TRACE_DEBUG, TRACEI, TRACING, XrdHttpReq::userAgent(), XrdSecEntity::vorg, XrdHttpProtoInfo::xrdctx, XrdHttpReq::xrdreq, and XRHTTP_TK_GRACETIME.
Here is the call graph for this function:
|
virtual |
Recycle this instance.
Implements XrdProtocol.
Definition at line 932 of file XrdHttpProtocol.cc.
References ProtLink, ProtStack, and XrdObjectQ< T >::Push().
Here is the call graph for this function:
|
virtual |
|
friend |
Definition at line 84 of file XrdHttpProtocol.hh.
|
friend |
Definition at line 83 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 369 of file XrdHttpProtocol.hh.
Referenced by XrdHttpProtocol(), and Process().
|
staticprotected |
Definition at line 360 of file XrdHttpProtocol.hh.
Referenced by Configure(), and Match().
|
protected |
The Bridge that we use to exercise the xrootd internals.
Definition at line 375 of file XrdHttpProtocol.hh.
Referenced by doChksum(), doStat(), Process(), and XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Definition at line 362 of file XrdHttpProtocol.hh.
|
static |
Definition at line 137 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Definition at line 410 of file XrdHttpProtocol.hh.
|
staticprotected |
CRL thread refresh interval.
Definition at line 405 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 380 of file XrdHttpProtocol.hh.
Referenced by doChksum(), doStat(), and Process().
|
staticprotected |
Definition at line 361 of file XrdHttpProtocol.hh.
Referenced by Configure(), and Process().
|
staticprotected |
If true, use the embedded css and icons.
Definition at line 431 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Gridmap file location. The same used by XrdSecGsi.
Definition at line 408 of file XrdHttpProtocol.hh.
|
staticprotected |
Timeout for reading the handshake.
Definition at line 390 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 451 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::parseLine().
|
staticprotected |
True if the redirections must be towards https targets.
Definition at line 419 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::Redir().
|
staticprotected |
Definition at line 409 of file XrdHttpProtocol.hh.
|
protected |
The link we are bound to.
Definition at line 365 of file XrdHttpProtocol.hh.
Referenced by XrdHttpExtReq::GetClientID(), Match(), and Process().
|
staticprotected |
If true, any form of listing is denied.
Definition at line 425 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Url to redirect to in the case a listing is requested.
Definition at line 422 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
C-style vptr table for our custom BIO objects.
Definition at line 457 of file XrdHttpProtocol.hh.
|
staticprotected |
Type identifier for our custom BIO objects.
Definition at line 454 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 438 of file XrdHttpProtocol.hh.
Referenced by Process().
|
staticprotected |
The static headers to always return; map is from verb to a list of (header, val) pairs.
Definition at line 469 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 473 of file XrdHttpProtocol.hh.
|
staticprotected |
Our role.
Definition at line 448 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 463 of file XrdHttpProtocol.hh.
Referenced by XrdHttpExtReq::XrdHttpExtReq(), and XrdHttpReq::parseLine().
|
staticprotected |
|
staticprotected |
Our port, as a string.
Definition at line 399 of file XrdHttpProtocol.hh.
Referenced by Configure(), and Process().
| XrdObject<XrdHttpProtocol> XrdHttpProtocol::ProtLink |
Definition at line 130 of file XrdHttpProtocol.hh.
Referenced by Recycle().
|
static |
Definition at line 129 of file XrdHttpProtocol.hh.
Referenced by Configure(), Match(), and Recycle().
|
static |
configuration for the read range handler
Definition at line 140 of file XrdHttpProtocol.hh.
|
staticprotected |
Timeout for reading data.
Definition at line 393 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 359 of file XrdHttpProtocol.hh.
Referenced by Configure().
| XrdSecEntity XrdHttpProtocol::SecEntity |
Authentication area.
Definition at line 134 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 413 of file XrdHttpProtocol.hh.
Referenced by Process(), and XrdHttpReq::Redir().
|
staticprotected |
If client is HTTPS, self-redirect with HTTP+token.
Definition at line 428 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 372 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 402 of file XrdHttpProtocol.hh.
Referenced by Process().
|
staticprotected |
Definition at line 402 of file XrdHttpProtocol.hh.
|
staticprotected |
OpenSSL stuff.
Definition at line 402 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 402 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 402 of file XrdHttpProtocol.hh.
|
staticprotected |
Depth of verification of a certificate chain.
Definition at line 416 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 445 of file XrdHttpProtocol.hh.
Referenced by XrdHttpReq::ProcessHTTPReq().
|
staticprotected |
Definition at line 434 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 466 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 460 of file XrdHttpProtocol.hh.
Referenced by Configure().
|
staticprotected |
Definition at line 384 of file XrdHttpProtocol.hh.
|
staticprotected |
Definition at line 382 of file XrdHttpProtocol.hh.