XRootD
Loading...
Searching...
No Matches
XrdHttpProtocol Class Reference

#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.
 ~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 bool allowMissingCRL = false
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 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.
static std::unordered_map< std::string, std::string > m_staticheaders
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 std::unordered_set< std::string > strp_cgi_params
 CGI parameters (names) to strip from redirect URLs.
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.
static XrdHttpCors * xrdcors = nullptr
static std::string xrdcorsLibPath

Friends

class XrdHttpExtReq
class XrdHttpReq

Detailed Description

Definition at line 81 of file XrdHttpProtocol.hh.


Class Documentation

◆ XrdHttpProtocol::StaticPreloadInfo

struct XrdHttpProtocol::StaticPreloadInfo

Definition at line 449 of file XrdHttpProtocol.hh.

Collaboration diagram for XrdHttpProtocol::StaticPreloadInfo:
Class Members
char * data
int len

Constructor & Destructor Documentation

◆ XrdHttpProtocol() [1/2]

XrdHttpProtocol::XrdHttpProtocol ( const XrdHttpProtocol & )
default

Ctor, dtors and copy ctor.

References XrdHttpProtocol().

Referenced by XrdHttpProtocol(), Match(), operator=(), and XrdgetProtocol().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XrdHttpProtocol() [2/2]

XrdHttpProtocol::XrdHttpProtocol ( bool imhttps)

Definition at line 173 of file XrdHttpProtocol.cc.

174: XrdProtocol("HTTP protocol handler"), ProtLink(this),
176 myBuff = 0;
177 Addr_str = 0;
178 Reset();
179 ishttps = imhttps;
180
181}
XrdObject< XrdHttpProtocol > ProtLink
static XrdHttpReadRangeHandler::Configuration ReadRangeConfig
configuration for the read range handler
XrdSecEntity SecEntity
Authentication area.
XrdProtocol(const char *jname)

References XrdProtocol::XrdProtocol(), Addr_str, CurrentReq, ProtLink, ReadRangeConfig, and SecEntity.

Here is the call graph for this function:

◆ ~XrdHttpProtocol()

XrdHttpProtocol::~XrdHttpProtocol ( )
inline

Definition at line 125 of file XrdHttpProtocol.hh.

125 {
126 Cleanup();
127 }

Member Function Documentation

◆ Configure()

int XrdHttpProtocol::Configure ( char * parms,
XrdProtocol_Config * pi )
static

Read and apply the configuration.

Definition at line 1699 of file XrdHttpProtocol.cc.

1699 {
1700 /*
1701 Function: Establish configuration at load time.
1702
1703 Input: None.
1704
1705 Output: 0 upon success or !0 otherwise.
1706 */
1707
1708 char *rdf;
1709
1710 // Copy out the special info we want to use at top level
1711 //
1712 eDest.logger(pi->eDest->logger());
1714 // SI = new XrdXrootdStats(pi->Stats);
1715 Sched = pi->Sched;
1716 BPool = pi->BPool;
1717 xrd_cslist = getenv("XRD_CSLIST");
1718
1719 Port = pi->Port;
1720
1721 // Copy out the current TLS context
1722 //
1723 xrdctx = pi->tlsCtx;
1724
1725 {
1726 char buf[16];
1727 sprintf(buf, "%d", Port);
1728 Port_str = strdup(buf);
1729 }
1730
1731 // Now process and configuration parameters
1732 //
1733 rdf = (parms && *parms ? parms : pi->ConfigFN);
1734 if (rdf && Config(rdf, pi->theEnv)) return 0;
1736
1737 // Set the redirect flag if we are a pure redirector
1739 if ((rdf = getenv("XRDROLE"))) {
1740 eDest.Emsg("Config", "XRDROLE: ", rdf);
1741
1742 if (!strcasecmp(rdf, "manager") || !strcasecmp(rdf, "supervisor")) {
1744 eDest.Emsg("Config", "Configured as HTTP(s) redirector.");
1745 } else {
1746
1747 eDest.Emsg("Config", "Configured as HTTP(s) data server.");
1748 }
1749
1750 } else {
1751 eDest.Emsg("Config", "No XRDROLE specified.");
1752 }
1753
1754 // Schedule protocol object cleanup
1755 //
1758 ProtStack.Set((pi->ConnMax / 3 ? pi->ConnMax / 3 : 30), 60 * 60);
1759
1760 // Return success
1761 //
1762
1763 return 1;
1764}
#define kXR_isManager
#define kXR_isServer
XrdSysTrace XrdHttpTrace("http")
#define TRACE_MEM
Definition XrdTrace.hh:38
#define TRACE_ALL
Definition XrdTrace.hh:35
static XrdScheduler * Sched
static kXR_int32 myRole
Our role.
static char * Port_str
Our port, as a string.
static XrdSysError eDest
static char * xrd_cslist
The list of checksums that were configured via the xrd.cksum parameter on the server config file.
static XrdObjectQ< XrdHttpProtocol > ProtStack
static int Port
Our port.
static XrdBuffManager * BPool
void Set(int inQMax, time_t agemax=1800)
Definition XrdObject.icc:90
XrdBuffManager * BPool
XrdScheduler * Sched
XrdTlsContext * tlsCtx
XrdSysError * eDest
XrdOucEnv * theEnv
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
XrdSysLogger * logger(XrdSysLogger *lp=0)
void SetLogger(XrdSysLogger *logp)
XrdTlsContext * xrdctx

References BPool, XrdProtocol_Config::BPool, XrdProtocol_Config::ConfigFN, XrdProtocol_Config::ConnMax, XrdProtocol_Config::DebugON, eDest, XrdProtocol_Config::eDest, XrdSysError::Emsg(), kXR_isManager, kXR_isServer, XrdSysError::logger(), myRole, Port, XrdProtocol_Config::Port, Port_str, ProtStack, Sched, XrdProtocol_Config::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(), and XrdHttpExtReq.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doChksum()

int XrdHttpProtocol::doChksum ( const XrdOucString & fname)

Perform a checksum request.

Definition at line 3121 of file XrdHttpProtocol.cc.

3121 {
3122 size_t length;
3123 memset(&CurrentReq.xrdreq, 0, sizeof (ClientRequest));
3129 length = fname.length() + 1;
3130 CurrentReq.xrdreq.query.dlen = htonl(length);
3131
3132 if (!Bridge) return -1;
3133
3134 return Bridge->Run(reinterpret_cast<char *>(&CurrentReq.xrdreq), const_cast<char *>(fname.c_str()), length) ? 0 : -1;
3135}
kXR_unt16 requestid
Definition XProtocol.hh:666
kXR_char reserved1[2]
Definition XProtocol.hh:668
kXR_char reserved2[8]
Definition XProtocol.hh:670
kXR_char fhandle[4]
Definition XProtocol.hh:669
@ kXR_query
Definition XProtocol.hh:114
struct ClientQueryRequest query
Definition XProtocol.hh:908
@ kXR_Qcksum
Definition XProtocol.hh:651
XrdXrootd::Bridge * Bridge
The Bridge that we use to exercise the xrootd internals.
ClientRequest xrdreq
The last issued xrd request, often pending.
int length() const
const char * c_str() const
virtual bool Run(const char *xreqP, char *xdataP=0, int xdataL=0)=0

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.

Here is the call graph for this function:

◆ DoIt()

void XrdHttpProtocol::DoIt ( )
inlinevirtual

Override from the base class.

Implements XrdJob.

Definition at line 92 of file XrdHttpProtocol.hh.

92 {
93 if (Resume) (*this.*Resume)();
94 }

◆ doStat()

int XrdHttpProtocol::doStat ( char * fname)

Perform a Stat request.

Definition at line 3093 of file XrdHttpProtocol.cc.

3093 {
3094 int l;
3095 bool b;
3096 CurrentReq.filesize = 0;
3099
3100 memset(&CurrentReq.xrdreq, 0, sizeof (ClientRequest));
3102 memset(CurrentReq.xrdreq.stat.reserved, 0,
3103 sizeof (CurrentReq.xrdreq.stat.reserved));
3104 l = strlen(fname) + 1;
3105 CurrentReq.xrdreq.stat.dlen = htonl(l);
3106
3107 if (!Bridge) return -1;
3108 b = Bridge->Run((char *) &CurrentReq.xrdreq, fname, l);
3109 if (!b) {
3110 return -1;
3111 }
3112
3113
3114 return 0;
3115}
@ kXR_stat
Definition XProtocol.hh:130
kXR_unt16 requestid
Definition XProtocol.hh:808
kXR_char reserved[7]
Definition XProtocol.hh:810
struct ClientStatRequest stat
Definition XProtocol.hh:915
long filemodtime
long long filesize

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.

Here is the call graph for this function:

◆ isHTTPS()

bool XrdHttpProtocol::isHTTPS ( )
inline

called via https

Definition at line 143 of file XrdHttpProtocol.hh.

143{ return ishttps; }

◆ Match()

XrdProtocol * XrdHttpProtocol::Match ( XrdLink * lp)
virtual

Tells if the oustanding bytes on the socket match this protocol implementation.

Implements XrdProtocol.

Definition at line 199 of file XrdHttpProtocol.cc.

199 {
200 char mybuf[16], mybuf2[1024];
201 XrdHttpProtocol *hp;
202 int dlen;
203 bool myishttps = false;
204
205 // Peek at the first 20 bytes of data
206 //
207 if ((dlen = lp->Peek(mybuf, (int) sizeof (mybuf), hailWait)) < (int) sizeof (mybuf)) {
208 if (dlen <= 0) lp->setEtext("handshake not received");
209 return (XrdProtocol *) 0;
210 }
211 mybuf[dlen - 1] = '\0';
212
213 // Trace the data
214 //
215
216 TRACEI(DEBUG, "received dlen: " << dlen);
217 //TRACEI(REQ, "received buf: " << mybuf);
218 mybuf2[0] = '\0';
219 for (int i = 0; i < dlen; i++) {
220 char mybuf3[16];
221 sprintf(mybuf3, "%.02d ", mybuf[i]);
222 strcat(mybuf2, mybuf3);
223
224 }
225 TRACEI(DEBUG, "received dump: " << mybuf2);
226
227 // Decide if it looks http or not. For now we are happy if all the received characters are alphanumeric
228 bool ismine = true;
229 for (int i = 0; i < dlen - 1; i++)
230 if (!isprint(mybuf[i]) && (mybuf[i] != '\r') && (mybuf[i] != '\n')) {
231 ismine = false;
232 TRACEI(DEBUG, "This does not look like http at pos " << i);
233 break;
234 }
235
236 // If it does not look http then look if it looks like https
237 if ((!ismine) && (dlen >= 4)) {
238 char check[4] = {00, 00, 00, 00};
239 if (memcmp(mybuf, check, 4)) {
240
241 if (httpsmode) {
242 ismine = true;
243 myishttps = true;
244 TRACEI(DEBUG, "This may look like https");
245 } else {
246 TRACEI(ALL, "This may look like https, but https is not configured");
247 }
248
249 }
250 }
251
252 if (!ismine) {
253 TRACEI(DEBUG, "This does not look like https. Protocol not matched.");
254 return (XrdProtocol *) 0;
255 }
256
257 // It does look http or https...
258 // Get a protocol object off the stack (if none, allocate a new one)
259 //
260
261 TRACEI(REQ, "Protocol matched. https: " << myishttps);
262 if (!(hp = ProtStack.Pop())) hp = new XrdHttpProtocol(myishttps);
263 else
264 hp->ishttps = myishttps;
265
266 // We now have to do some work arounds to tell the underlying framework
267 // that is is https without invoking TLS on the actual link. Eventually,
268 // we should just use the link's TLS native implementation.
269 //
270 hp->SecEntity.addrInfo = lp->AddrInfo();
271 XrdNetAddr *netP = const_cast<XrdNetAddr*>(lp->NetAddr());
272 netP->SetDialect("https");
273 netP->SetTLS(true);
274
275 // Allocate 1MB buffer from pool
276 if (!hp->myBuff) {
277 hp->myBuff = BPool->Obtain(1024 * 1024);
278 }
279 hp->myBuffStart = hp->myBuffEnd = hp->myBuff->buff;
280
281 // Bind the protocol to the link and return the protocol
282 //
283 hp->Link = lp;
284 return (XrdProtocol *) hp;
285}
#define DEBUG(x)
#define TRACEI(act, x)
Definition XrdTrace.hh:66
XrdBuffer * Obtain(int bsz)
Definition XrdBuffer.cc:140
char * buff
Definition XrdBuffer.hh:45
static int hailWait
Timeout for reading the handshake.
XrdLink * Link
The link we are bound to.
XrdHttpProtocol(const XrdHttpProtocol &)=default
Ctor, dtors and copy ctor.
void SetDialect(const char *dP)
void SetTLS(bool val)
T * Pop()
Definition XrdObject.hh:93
XrdNetAddrInfo * addrInfo
Entity's connection details.

References XrdHttpProtocol(), XrdProtocol::XrdProtocol(), 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:

◆ operator=()

XrdHttpProtocol XrdHttpProtocol::operator= ( const XrdHttpProtocol & rhs)

Definition at line 188 of file XrdHttpProtocol.cc.

188 {
189
190 return *this;
191}

References XrdHttpProtocol().

Here is the call graph for this function:

◆ parseHeader2CGI()

int XrdHttpProtocol::parseHeader2CGI ( XrdOucStream & Config,
XrdSysError & err,
std::map< std::string, std::string > & header2cgi )
static

Use this function to parse header2cgi configurations.

Definition at line 1769 of file XrdHttpProtocol.cc.

1769 {
1770 char *val, keybuf[1024], parmbuf[1024];
1771 char *parm;
1772 bool strip_on_redirect = false;
1773
1774 // Get the header key
1775 val = Config.GetWord();
1776 if (!val || !val[0]) {
1777 err.Emsg("Config", "No headerkey specified.");
1778 return 1;
1779 } else {
1780
1781 // Trim the beginning, in place
1782 while ( *val && !isalnum(*val) ) val++;
1783 strcpy(keybuf, val);
1784
1785 // Trim the end, in place
1786 char *pp;
1787 pp = keybuf + strlen(keybuf) - 1;
1788 while ( (pp >= keybuf) && (!isalnum(*pp)) ) {
1789 *pp = '\0';
1790 pp--;
1791 }
1792
1793 parm = Config.GetWord();
1794
1795 // Avoids segfault in case a key is given without value
1796 if(!parm || !parm[0]) {
1797 err.Emsg("Config", "No header2cgi value specified. key: '", keybuf, "'");
1798 return 1;
1799 }
1800
1801 // Trim the beginning, in place
1802 while ( *parm && !isalnum(*parm) ) parm++;
1803 strcpy(parmbuf, parm);
1804
1805 // Trim the end, in place
1806 pp = parmbuf + strlen(parmbuf) - 1;
1807 while ( (pp >= parmbuf) && (!isalnum(*pp)) ) {
1808 *pp = '\0';
1809 pp--;
1810 }
1811
1812 // Check for optional strip-on-redirect parameter
1813 char *nextWord = Config.GetWord();
1814 if (nextWord && nextWord[0] && !strcasecmp(nextWord, "strip-on-redirect")) {
1815 strip_on_redirect = true;
1816 }
1817
1818 // Add this mapping to the map that will be used
1819 try {
1820 header2cgi[keybuf] = parmbuf;
1821 if (strip_on_redirect) {
1822 strp_cgi_params.insert(parmbuf);
1823 }
1824 } catch ( ... ) {
1825 err.Emsg("Config", "Can't insert new header2cgi rule. key: '", keybuf, "'");
1826 return 1;
1827 }
1828
1829 }
1830 return 0;
1831}
static std::unordered_set< std::string > strp_cgi_params
CGI parameters (names) to strip from redirect URLs.

References XrdSysError::Emsg(), and strp_cgi_params.

Here is the call graph for this function:

◆ Process()

int XrdHttpProtocol::Process ( XrdLink * lp)
virtual

Process data incoming from the socket.

Implements XrdProtocol.

Definition at line 398 of file XrdHttpProtocol.cc.

399{
400 int rc = 0;
401
402 TRACEI(DEBUG, " Process. lp:"<<(void *)lp<<" reqstate: "<<CurrentReq.reqstate);
403
404 if (CurrentReq.startTime == std::chrono::steady_clock::time_point::min()) {
405 CurrentReq.startTime = std::chrono::steady_clock::now();
406 }
407
408 if (!myBuff || !myBuff->buff || !myBuff->bsize) {
409 TRACE(ALL, " Process. No buffer available. Internal error.");
410 return -1;
411 }
412
413
414 if (!SecEntity.host) {
415 char *nfo = GetClientIPStr();
416 if (nfo) {
417 TRACEI(REQ, " Setting host: " << nfo);
418 SecEntity.host = nfo;
419 strcpy(SecEntity.prot, "http");
420 }
421 }
422
423
424
425 // If https then check independently for the ssl handshake
426 if (ishttps && !ssldone) {
427
428 if (!ssl) {
429 sbio = CreateBIO(Link);
430 BIO_set_nbio(sbio, 1);
431 ssl = (SSL*)xrdctx->Session();
432 }
433
434 if (!ssl) {
435 TRACEI(DEBUG, " SSL_new returned NULL");
436 ERR_print_errors(sslbio_err);
437 return -1;
438 }
439
440 // If a secxtractor has been loaded
441 // maybe it wants to add its own initialization bits
442 if (secxtractor)
443 secxtractor->InitSSL(ssl, sslcadir);
444
445 SSL_set_bio(ssl, sbio, sbio);
446 //SSL_set_connect_state(ssl);
447
448 //SSL_set_fd(ssl, Link->FDnum());
449 struct timeval tv;
450 tv.tv_sec = 10;
451 tv.tv_usec = 0;
452 setsockopt(Link->FDnum(), SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)&tv, sizeof(struct timeval));
453 setsockopt(Link->FDnum(), SOL_SOCKET, SO_SNDTIMEO, (struct timeval *)&tv, sizeof(struct timeval));
454
455 TRACEI(DEBUG, " Entering SSL_accept...");
456 int res = SSL_accept(ssl);
457 TRACEI(DEBUG, " SSL_accept returned :" << res);
458 if ((res == -1) && (SSL_get_error(ssl, res) == SSL_ERROR_WANT_READ)) {
459 TRACEI(DEBUG, " SSL_accept wants to read more bytes... err:" << SSL_get_error(ssl, res));
460 return 1;
461 }
462
463 if(res <= 0) {
464 ERR_print_errors(sslbio_err);
465 if (res < 0) {
466
467 SSL_free(ssl);
468 ssl = 0;
469 return -1;
470 }
471 }
472
473 BIO_set_nbio(sbio, 0);
474
475 strcpy(SecEntity.prot, "https");
476
477 // Get the voms string and auth information
478 if (tlsClientAuth && HandleAuthentication(Link)) {
479 SSL_free(ssl);
480 ssl = 0;
481 return -1;
482 }
483
484 ssldone = true;
485 if (TRACING(TRACE_AUTH)) {
487 }
488 }
489
490
491
492 if (!DoingLogin) {
493 // Re-invocations triggered by the bridge have lp==0
494 // In this case we keep track of a different request state
495 if (lp) {
496
497 // This is an invocation that was triggered by a socket event
498 // Read all the data that is available, throw it into the buffer
499 if ((rc = getDataOneShot(BuffAvailable())) < 0) {
500 // Error -> exit
501 return -1;
502 }
503
504 // If we need more bytes, let's wait for another invokation
505 if (BuffUsed() < ResumeBytes) return 1;
506
507
508 } else
510 } else if (!DoneSetInfo && !CurrentReq.userAgent().empty()) { // DoingLogin is true, meaning the login finished.
511 std::string mon_info = "monitor info " + CurrentReq.userAgent();
512 DoneSetInfo = true;
513 if (mon_info.size() >= 1024) {
514 TRACEI(ALL, "User agent string too long");
515 } else if (!Bridge) {
516 TRACEI(ALL, "Internal logic error: Bridge is null after login");
517 } else {
518 TRACEI(DEBUG, "Setting " << mon_info);
519 memset(&CurrentReq.xrdreq, 0, sizeof (ClientRequest));
522 memset(CurrentReq.xrdreq.set.reserved, '\0', sizeof(CurrentReq.xrdreq.set.reserved));
523 CurrentReq.xrdreq.set.dlen = htonl(mon_info.size());
524 if (!Bridge->Run((char *) &CurrentReq.xrdreq, (char *) mon_info.c_str(), mon_info.size())) {
525 SendSimpleResp(500, nullptr, nullptr, "Could not set user agent.", 0, false);
526 return -1;
527 }
528 return 0;
529 }
530 } else {
531 DoingLogin = false;
532 }
533
534 // Read the next request header, that is, read until a double CRLF is found
535
536
537 if (!CurrentReq.headerok) {
538
539 // Read as many lines as possible into the buffer. An empty line breaks
540 while ((rc = BuffgetLine(tmpline)) > 0) {
541 std::string traceLine = tmpline.c_str();
542 if (TRACING(TRACE_DEBUG)) {
543 traceLine = obfuscateAuth(traceLine);
544 }
545 TRACE(DEBUG, " rc:" << rc << " got hdr line: " << traceLine);
546 if ((rc == 2) && (tmpline.length() == 2) && (tmpline[0] == '\r') && (tmpline[1] == '\n')) {
548 CurrentReq.headerok = true;
549 TRACE(DEBUG, " rc:" << rc << " detected header end.");
550 break;
551 }
552 }
553
554
556 TRACE(DEBUG, " Parsing first line: " << traceLine.c_str());
557 int result = CurrentReq.parseFirstLine((char *)tmpline.c_str(), tmpline.length());
558 if (result < 0) {
559 TRACE(DEBUG, " Parsing of first line failed with " << result);
560 return -1;
561 }
562 } else {
563 int result = CurrentReq.parseLine((char *) tmpline.c_str(), tmpline.length());
564 if(result < 0) {
565 TRACE(DEBUG, " Parsing of header line failed with " << result)
566 SendSimpleResp(400,NULL,NULL,"Malformed header line. Hint: ensure the line finishes with \"\\r\\n\"", 0, false);
567 return -1;
568 }
569 }
570
571
572 }
573
574 // Here we have CurrentReq loaded with the header, or its relevant fields
575
576 if (!CurrentReq.headerok) {
577 TRACEI(REQ, " rc:" << rc << "Header not yet complete.");
578
579 // Here a subtle error condition. IF we failed reading a line AND the buffer
580 // has a reasonable amount of data available THEN we consider the header
581 // as corrupted and shutdown the client
582 if ((rc <= 0) && (BuffUsed() >= 16384)) {
583 TRACEI(ALL, "Corrupted header detected, or line too long. Disconnecting client.");
584 return -1;
585 }
586
587
588 if (CurrentReq.reqstate > 0)
590 // Waiting for more data
591 return 1;
592 }
593
594 }
595
596 // If we are in self-redirect mode, then let's do it
597 // Do selfredirect only with 'simple' requests, otherwise poor clients may misbehave
598 if (ishttps && ssldone && selfhttps2http &&
601 char hash[512];
602 time_t timenow = time(0);
603
604
606 &SecEntity,
607 timenow,
608 secretkey);
609
610
611
612 if (hash[0]) {
613
614 // Workaround... delete the previous opaque information
615 if (CurrentReq.opaque) {
616 delete CurrentReq.opaque;
617 CurrentReq.opaque = 0;
618 }
619
620 TRACEI(REQ, " rc:" << rc << " self-redirecting to http with security token.");
621
622 XrdOucString dest = "Location: http://";
623 // Here I should put the IP addr of the server
624
625 // We have to recompute it here because we don't know to which
626 // interface the client had connected to
627 struct sockaddr_storage sa;
628 socklen_t sl = sizeof(sa);
629 getsockname(this->Link->AddrInfo()->SockFD(), (struct sockaddr*)&sa, &sl);
630
631 // now get it back and print it
632 char buf[256];
633 bool ok = false;
634
635 switch (sa.ss_family) {
636 case AF_INET:
637 if (inet_ntop(AF_INET, &(((sockaddr_in*)&sa)->sin_addr), buf, INET_ADDRSTRLEN)) {
638 if (Addr_str) free(Addr_str);
639 Addr_str = strdup(buf);
640 ok = true;
641 }
642 break;
643 case AF_INET6:
644 if (inet_ntop(AF_INET6, &(((sockaddr_in6*)&sa)->sin6_addr), buf, INET6_ADDRSTRLEN)) {
645 if (Addr_str) free(Addr_str);
646 Addr_str = (char *)malloc(strlen(buf)+3);
647 strcpy(Addr_str, "[");
648 strcat(Addr_str, buf);
649 strcat(Addr_str, "]");
650 ok = true;
651 }
652 break;
653 default:
654 TRACEI(REQ, " Can't recognize the address family of the local host.");
655 }
656
657 if (ok) {
658 dest += Addr_str;
659 dest += ":";
660 dest += Port_str;
661 dest += CurrentReq.resource.c_str();
662 TRACEI(REQ," rc:"<<rc<<" self-redirecting to http with security token: '"
663 << dest.c_str() << "'");
664
665
666 CurrentReq.appendOpaque(dest, &SecEntity, hash, timenow);
667 SendSimpleResp(302, NULL, (char *) dest.c_str(), 0, 0, false);
669 return -1;
670 }
671
672 TRACEI(REQ, " rc:" << rc << " Can't perform self-redirection.");
673
674 }
675 else {
676 TRACEI(ALL, " Could not calculate self-redirection hash");
677 }
678 }
679
680 // If this is not https, then extract the signed information from the url
681 // and fill the SecEntity structure as if we were using https
682 if (!ishttps && !ssldone) {
683
684
685 if (CurrentReq.opaque) {
686 char * tk = CurrentReq.opaque->Get("xrdhttptk");
687 // If there is a hash then we use it as authn info
688 if (tk) {
689
690 time_t tim = 0;
691 char * t = CurrentReq.opaque->Get("xrdhttptime");
692 if (t) tim = atoi(t);
693 if (!t) {
694 TRACEI(REQ, " xrdhttptime not specified. Authentication failed.");
695 return -1;
696 }
697 if (abs(time(0) - tim) > XRHTTP_TK_GRACETIME) {
698 TRACEI(REQ, " Token expired. Authentication failed.");
699 return -1;
700 }
701
702 // Fill the Secentity from the fields in the URL:name, vo, host
703 char *nfo;
704
705 nfo = CurrentReq.opaque->Get("xrdhttpvorg");
706 if (nfo) {
707 TRACEI(DEBUG, " Setting vorg: " << nfo);
708 SecEntity.vorg = strdup(nfo);
709 TRACEI(REQ, " Setting vorg: " << SecEntity.vorg);
710 }
711
712 nfo = CurrentReq.opaque->Get("xrdhttpname");
713 if (nfo) {
714 TRACEI(DEBUG, " Setting name: " << nfo);
715 SecEntity.name = strdup(decode_str(nfo).c_str());
716 TRACEI(REQ, " Setting name: " << SecEntity.name);
717 }
718
719 nfo = CurrentReq.opaque->Get("xrdhttphost");
720 if (nfo) {
721 TRACEI(DEBUG, " Setting host: " << nfo);
722 if (SecEntity.host) free(SecEntity.host);
723 SecEntity.host = strdup(decode_str(nfo).c_str());
724 TRACEI(REQ, " Setting host: " << SecEntity.host);
725 }
726
727 nfo = CurrentReq.opaque->Get("xrdhttpdn");
728 if (nfo) {
729 TRACEI(DEBUG, " Setting dn: " << nfo);
730 SecEntity.moninfo = strdup(decode_str(nfo).c_str());
731 TRACEI(REQ, " Setting dn: " << SecEntity.moninfo);
732 }
733
734 nfo = CurrentReq.opaque->Get("xrdhttprole");
735 if (nfo) {
736 TRACEI(DEBUG, " Setting role: " << nfo);
737 SecEntity.role = strdup(decode_str(nfo).c_str());
738 TRACEI(REQ, " Setting role: " << SecEntity.role);
739 }
740
741 nfo = CurrentReq.opaque->Get("xrdhttpgrps");
742 if (nfo) {
743 TRACEI(DEBUG, " Setting grps: " << nfo);
744 SecEntity.grps = strdup(decode_str(nfo).c_str());
745 TRACEI(REQ, " Setting grps: " << SecEntity.grps);
746 }
747
748 nfo = CurrentReq.opaque->Get("xrdhttpendorsements");
749 if (nfo) {
750 TRACEI(DEBUG, " Setting endorsements: " << nfo);
751 SecEntity.endorsements = strdup(decode_str(nfo).c_str());
752 TRACEI(REQ, " Setting endorsements: " << SecEntity.endorsements);
753 }
754
755 nfo = CurrentReq.opaque->Get("xrdhttpcredslen");
756 if (nfo) {
757 TRACEI(DEBUG, " Setting credslen: " << nfo);
758 char *s1 = strdup(decode_str(nfo).c_str());
759 if (s1 && s1[0]) {
760 SecEntity.credslen = atoi(s1);
761 TRACEI(REQ, " Setting credslen: " << SecEntity.credslen);
762 }
763 if (s1) free(s1);
764 }
765
766 if (SecEntity.credslen) {
767 nfo = CurrentReq.opaque->Get("xrdhttpcreds");
768 if (nfo) {
769 TRACEI(DEBUG, " Setting creds: " << nfo);
770 SecEntity.creds = strdup(decode_str(nfo).c_str());
771 TRACEI(REQ, " Setting creds: " << SecEntity.creds);
772 }
773 }
774
775 char hash[512];
776
778 &SecEntity,
779 tim,
780 secretkey);
781
782 if (compareHash(hash, tk)) {
783 TRACEI(REQ, "Invalid tk '" << tk << "' != '" << hash << "' (calculated). Authentication failed.");
784 SendSimpleResp(400, nullptr, nullptr, "Authentication failed: invalid token", 0, false);
785 return -1;
786 }
787
788 } else {
789 // Client is plain http. If we have a secret key then we reject it
790 if (secretkey) {
791 TRACEI(ALL, " Rejecting plain http with no valid token as we have a secretkey.");
792 return -1;
793 }
794 }
795
796 } else {
797 // Client is plain http. If we have a secret key then we reject it
798 if (secretkey) {
799 TRACEI(ALL, " Rejecting plain http with no valid token as we have a secretkey.");
800 return -1;
801 }
802 }
803
804 ssldone = true;
805 }
806
807
808
809 // Now we have everything that is needed to try the login
810 // Remember that if there is an exthandler then it has the responsibility
811 // for authorization in the paths that it manages
812 if (!Bridge && !FindMatchingExtHandler(CurrentReq)) {
813 if (SecEntity.name)
814 Bridge = XrdXrootd::Bridge::Login(&CurrentReq, Link, &SecEntity, SecEntity.name, ishttps ? "https" : "http");
815 else
816 Bridge = XrdXrootd::Bridge::Login(&CurrentReq, Link, &SecEntity, "unknown", ishttps ? "https" : "http");
817
818 if (!Bridge) {
819 TRACEI(REQ, " Authorization failed.");
820 return -1;
821 }
822 if (m_maxdelay > 0) Bridge->SetWait(m_maxdelay, false);
823
824 // Let the bridge process the login, and then reinvoke us
825 DoingLogin = true;
826 return 0;
827 }
828
829 // Compute and send the response. This may involve further reading from the socket
831 if (rc < 0)
833
834
835
836 TRACEI(REQ, "Process is exiting rc:" << rc);
837 return rc;
838}
struct ClientSetRequest set
Definition XProtocol.hh:913
@ kXR_set
Definition XProtocol.hh:131
kXR_unt16 requestid
Definition XProtocol.hh:755
kXR_char modifier
Definition XProtocol.hh:757
kXR_char reserved[15]
Definition XProtocol.hh:756
short kXR_int16
Definition XPtypes.hh:66
#define XRHTTP_TK_GRACETIME
#define TRACE_AUTH
int compareHash(const char *h1, const char *h2)
void calcHashes(char *hash, const char *fn, kXR_int16 request, XrdSecEntity *secent, time_t tim, const char *key)
std::string decode_str(const std::string &str)
std::string obfuscateAuth(const std::string &input)
#define TRACE_DEBUG
Definition XrdTrace.hh:36
#define TRACE(act, x)
Definition XrdTrace.hh:63
#define TRACING(x)
Definition XrdTrace.hh:70
static char * secretkey
The key used to calculate the url hashes.
static bool selfhttps2http
If client is HTTPS, self-redirect with HTTP+token.
static char * sslcadir
int reqstate
State machine to talk to the bridge.
XrdOucString resource
The resource specified by the request, stripped of opaque data.
bool headerok
Tells if we have finished reading the header.
const std::string & userAgent() const
ReqType request
The request we got.
int ProcessHTTPReq()
XrdOucEnv * opaque
The opaque data, after parsing.
int parseFirstLine(char *line, int len)
Parse the first line of the header.
int parseLine(char *line, int len)
Parse the header.
void appendOpaque(XrdOucString &s, XrdSecEntity *secent, char *hash, time_t tnow)
std::chrono::steady_clock::time_point startTime
virtual void reset()
char * Get(const char *varname)
Definition XrdOucEnv.hh:69
char * vorg
Entity's virtual organization(s).
int credslen
Length of the 'creds' data.
char prot[XrdSecPROTOIDSIZE]
Auth protocol used (e.g. krb5).
char * creds
Raw entity credentials or cert.
char * grps
Entity's group name(s).
char * name
Entity's name.
char * role
Entity's role(s).
char * endorsements
Protocol specific endorsements.
void Display(XrdSysError &mDest)
char * moninfo
Information for monitoring.
char * host
Entity's host name dnr dependent.
static Bridge * Login(Result *rsltP, XrdLink *linkP, XrdSecEntity *seceP, const char *nameP, const char *protP)
virtual void SetWait(int wtime, bool notify=false)=0

References Addr_str, XrdLink::AddrInfo(), XrdHttpReq::appendOpaque(), Bridge, 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, kXR_set, 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, XrdHttpReq::startTime, 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:

◆ Recycle()

void XrdHttpProtocol::Recycle ( XrdLink * lp,
int consec,
const char * reason )
virtual

Recycle this instance.

Implements XrdProtocol.

Definition at line 846 of file XrdHttpProtocol.cc.

846 {
847
848 // Release all appendages
849 //
850
851 Cleanup();
852
853
854 // Set fields to starting point (debugging mostly)
855 //
856 Reset();
857
858 // Push ourselves on the stack
859 //
861}
void Push(XrdObject< T > *Node)
Definition XrdObject.hh:101

References ProtLink, ProtStack, and XrdObjectQ< T >::Push().

Here is the call graph for this function:

◆ Stats()

int XrdHttpProtocol::Stats ( char * buff,
int blen,
int do_sync = 0 )
virtual

Get activity stats.

Implements XrdProtocol.

Definition at line 863 of file XrdHttpProtocol.cc.

863 {
864 // Synchronize statistics if need be
865 //
866 // if (do_sync) {
867 //
868 // SI->statsMutex.Lock();
869 // SI->readCnt += numReads;
870 // cumReads += numReads;
871 // numReads = 0;
872 // SI->prerCnt += numReadP;
873 // cumReadP += numReadP;
874 // numReadP = 0;
875 // SI->rvecCnt += numReadV;
876 // cumReadV += numReadV;
877 // numReadV = 0;
878 // SI->rsegCnt += numSegsV;
879 // cumSegsV += numSegsV;
880 // numSegsV = 0;
881 // SI->writeCnt += numWrites;
882 // cumWrites += numWrites;
883 // numWrites = 0;
884 // SI->statsMutex.UnLock();
885 // }
886 //
887 // // Now return the statistics
888 // //
889 // return SI->Stats(buff, blen, do_sync);
890
891 return 0;
892}

◆ XrdHttpExtReq

friend class XrdHttpExtReq
friend

Definition at line 84 of file XrdHttpProtocol.hh.

References Configure(), and XrdHttpExtReq.

Referenced by XrdHttpExtReq.

◆ XrdHttpReq

friend class XrdHttpReq
friend

Definition at line 83 of file XrdHttpProtocol.hh.

References XrdHttpReq.

Referenced by XrdHttpReq.

Member Data Documentation

◆ Addr_str

char* XrdHttpProtocol::Addr_str
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 371 of file XrdHttpProtocol.hh.

Referenced by XrdHttpProtocol(), and Process().

◆ allowMissingCRL

bool XrdHttpProtocol::allowMissingCRL = false
staticprotected

Definition at line 410 of file XrdHttpProtocol.hh.

◆ BPool

XrdBuffManager * XrdHttpProtocol::BPool = 0
staticprotected

Definition at line 362 of file XrdHttpProtocol.hh.

Referenced by Configure(), and Match().

◆ Bridge

XrdXrootd::Bridge* XrdHttpProtocol::Bridge
protected

The Bridge that we use to exercise the xrootd internals.

Definition at line 377 of file XrdHttpProtocol.hh.

Referenced by doChksum(), doStat(), and Process().

◆ CIA

XrdSecService * XrdHttpProtocol::CIA = 0
staticprotected

Definition at line 364 of file XrdHttpProtocol.hh.

◆ cksumHandler

XrdHttpChecksumHandler XrdHttpProtocol::cksumHandler = XrdHttpChecksumHandler()
static

Definition at line 137 of file XrdHttpProtocol.hh.

◆ compatNameGeneration

bool XrdHttpProtocol::compatNameGeneration = false
staticprotected

Definition at line 415 of file XrdHttpProtocol.hh.

◆ crlRefIntervalSec

int XrdHttpProtocol::crlRefIntervalSec = XrdTlsContext::DEFAULT_CRL_REF_INT_SEC
staticprotected

CRL thread refresh interval.

Definition at line 407 of file XrdHttpProtocol.hh.

◆ CurrentReq

XrdHttpReq XrdHttpProtocol::CurrentReq
protected

Area for coordinating request and responses to/from the bridge This also can process HTTP/DAV stuff

Definition at line 382 of file XrdHttpProtocol.hh.

Referenced by XrdHttpProtocol(), doChksum(), doStat(), and Process().

◆ eDest

XrdSysError XrdHttpProtocol::eDest = 0
staticprotected

Definition at line 363 of file XrdHttpProtocol.hh.

Referenced by Configure(), and Process().

◆ embeddedstatic

bool XrdHttpProtocol::embeddedstatic = true
staticprotected

If true, use the embedded css and icons.

Definition at line 439 of file XrdHttpProtocol.hh.

◆ gridmap

char * XrdHttpProtocol::gridmap = 0
staticprotected

Gridmap file location. The same used by XrdSecGsi.

Definition at line 413 of file XrdHttpProtocol.hh.

◆ hailWait

int XrdHttpProtocol::hailWait = 60000
staticprotected

Timeout for reading the handshake.

Definition at line 392 of file XrdHttpProtocol.hh.

Referenced by Match().

◆ hdr2cgimap

std::map< std::string, std::string > XrdHttpProtocol::hdr2cgimap
staticprotected

Rules that turn HTTP headers to cgi tokens in the URL, for internal comsumption.

Definition at line 459 of file XrdHttpProtocol.hh.

◆ isdesthttps

bool XrdHttpProtocol::isdesthttps = false
staticprotected

True if the redirections must be towards https targets.

Definition at line 424 of file XrdHttpProtocol.hh.

◆ isRequiredGridmap

bool XrdHttpProtocol::isRequiredGridmap = false
staticprotected

Definition at line 414 of file XrdHttpProtocol.hh.

◆ Link

XrdLink* XrdHttpProtocol::Link
protected

The link we are bound to.

Definition at line 367 of file XrdHttpProtocol.hh.

Referenced by Match(), and Process().

◆ listdeny

bool XrdHttpProtocol::listdeny = false
staticprotected

If true, any form of listing is denied.

Definition at line 430 of file XrdHttpProtocol.hh.

◆ listredir

char * XrdHttpProtocol::listredir = 0
staticprotected

Url to redirect to in the case a listing is requested.

Definition at line 427 of file XrdHttpProtocol.hh.

◆ m_bio_method

BIO_METHOD * XrdHttpProtocol::m_bio_method = NULL
staticprotected

C-style vptr table for our custom BIO objects.

Definition at line 465 of file XrdHttpProtocol.hh.

◆ m_bio_type

int XrdHttpProtocol::m_bio_type = 0
staticprotected

Type identifier for our custom BIO objects.

Definition at line 462 of file XrdHttpProtocol.hh.

◆ m_maxdelay

int XrdHttpProtocol::m_maxdelay = -1
staticprotected

Definition at line 446 of file XrdHttpProtocol.hh.

Referenced by Process().

◆ m_staticheader_map

decltype(XrdHttpProtocol::m_staticheader_map) XrdHttpProtocol::m_staticheader_map
staticprotected

The static headers to always return; map is from verb to a list of (header, val) pairs.

Definition at line 477 of file XrdHttpProtocol.hh.

◆ m_staticheaders

decltype(XrdHttpProtocol::m_staticheaders) XrdHttpProtocol::m_staticheaders
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 481 of file XrdHttpProtocol.hh.

◆ myRole

kXR_int32 XrdHttpProtocol::myRole = kXR_isManager
staticprotected

Our role.

Definition at line 456 of file XrdHttpProtocol.hh.

Referenced by Configure().

◆ pmarkHandle

XrdNetPMark * XrdHttpProtocol::pmarkHandle = nullptr
staticprotected

Packet marking handler pointer (assigned from the environment during the Config() call).

Definition at line 471 of file XrdHttpProtocol.hh.

◆ Port

int XrdHttpProtocol::Port = 1094
staticprotected

Our port.

Definition at line 398 of file XrdHttpProtocol.hh.

Referenced by Configure().

◆ Port_str

char * XrdHttpProtocol::Port_str = 0
staticprotected

Our port, as a string.

Definition at line 401 of file XrdHttpProtocol.hh.

Referenced by Configure(), and Process().

◆ ProtLink

XrdObject<XrdHttpProtocol> XrdHttpProtocol::ProtLink

Definition at line 130 of file XrdHttpProtocol.hh.

Referenced by XrdHttpProtocol(), and Recycle().

◆ ProtStack

XrdObjectQ< XrdHttpProtocol > XrdHttpProtocol::ProtStack
static

Definition at line 129 of file XrdHttpProtocol.hh.

Referenced by Configure(), Match(), and Recycle().

◆ ReadRangeConfig

XrdHttpReadRangeHandler::Configuration XrdHttpProtocol::ReadRangeConfig
static

configuration for the read range handler

Definition at line 140 of file XrdHttpProtocol.hh.

Referenced by XrdHttpProtocol().

◆ readWait

int XrdHttpProtocol::readWait = 300000
staticprotected

Timeout for reading data.

Definition at line 395 of file XrdHttpProtocol.hh.

◆ Sched

XrdScheduler * XrdHttpProtocol::Sched = 0
staticprotected

Definition at line 361 of file XrdHttpProtocol.hh.

Referenced by Configure().

◆ SecEntity

XrdSecEntity XrdHttpProtocol::SecEntity

Authentication area.

Definition at line 134 of file XrdHttpProtocol.hh.

Referenced by XrdHttpProtocol(), Match(), and Process().

◆ secretkey

char * XrdHttpProtocol::secretkey = 0
staticprotected

The key used to calculate the url hashes.

Definition at line 418 of file XrdHttpProtocol.hh.

Referenced by Process().

◆ selfhttps2http

bool XrdHttpProtocol::selfhttps2http = false
staticprotected

If client is HTTPS, self-redirect with HTTP+token.

Definition at line 433 of file XrdHttpProtocol.hh.

Referenced by Process().

◆ servGMap

XrdOucGMap * XrdHttpProtocol::servGMap = 0
staticprotected

The instance of the DN mapper. Created only when a valid path is given.

Definition at line 374 of file XrdHttpProtocol.hh.

◆ sslcadir

char * XrdHttpProtocol::sslcadir = 0
staticprotected

Definition at line 404 of file XrdHttpProtocol.hh.

Referenced by Process().

◆ sslcafile

char * XrdHttpProtocol::sslcafile = 0
staticprotected

Definition at line 404 of file XrdHttpProtocol.hh.

◆ sslcert

char * XrdHttpProtocol::sslcert = 0
staticprotected

OpenSSL stuff.

Definition at line 404 of file XrdHttpProtocol.hh.

◆ sslcipherfilter

char * XrdHttpProtocol::sslcipherfilter = 0
staticprotected

Definition at line 404 of file XrdHttpProtocol.hh.

◆ sslkey

char * XrdHttpProtocol::sslkey = 0
staticprotected

Definition at line 404 of file XrdHttpProtocol.hh.

◆ sslverifydepth

int XrdHttpProtocol::sslverifydepth = 9
staticprotected

Depth of verification of a certificate chain.

Definition at line 421 of file XrdHttpProtocol.hh.

◆ staticpreload

XrdOucHash< XrdHttpProtocol::StaticPreloadInfo > * XrdHttpProtocol::staticpreload = 0
staticprotected

Definition at line 453 of file XrdHttpProtocol.hh.

◆ staticredir

char * XrdHttpProtocol::staticredir = 0
staticprotected

Definition at line 442 of file XrdHttpProtocol.hh.

◆ strp_cgi_params

std::unordered_set< std::string > XrdHttpProtocol::strp_cgi_params
staticprotected

CGI parameters (names) to strip from redirect URLs.

Definition at line 436 of file XrdHttpProtocol.hh.

Referenced by parseHeader2CGI().

◆ tpcForwardCreds

bool XrdHttpProtocol::tpcForwardCreds = false
staticprotected

If set to true, the HTTP TPC transfers will forward the credentials to redirected hosts.

Definition at line 474 of file XrdHttpProtocol.hh.

◆ xrd_cslist

char * XrdHttpProtocol::xrd_cslist = nullptr
staticprotected

The list of checksums that were configured via the xrd.cksum parameter on the server config file.

Definition at line 468 of file XrdHttpProtocol.hh.

Referenced by Configure().

◆ xrdcors

XrdHttpCors * XrdHttpProtocol::xrdcors = nullptr
staticprotected

Definition at line 386 of file XrdHttpProtocol.hh.

◆ xrdcorsLibPath

std::string XrdHttpProtocol::xrdcorsLibPath
staticprotected

Definition at line 384 of file XrdHttpProtocol.hh.


The documentation for this class was generated from the following files: