XRootD
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. 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...
 
XrdProtocolMatch (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< XrdHttpProtocolProtLink
 
XrdSecEntity SecEntity
 Authentication area. More...
 
- Public Attributes inherited from XrdJob
const char * Comment
 
XrdJobNextJob
 

Static Public Attributes

static XrdHttpChecksumHandler cksumHandler = XrdHttpChecksumHandler()
 
static XrdObjectQ< XrdHttpProtocolProtStack
 
static XrdHttpReadRangeHandler::Configuration ReadRangeConfig
 configuration for the read range handler More...
 

Protected Attributes

char * Addr_str
 
XrdXrootd::BridgeBridge
 The Bridge that we use to exercise the xrootd internals. More...
 
XrdHttpReq CurrentReq
 
XrdLinkLink
 The link we are bound to. More...
 

Static Protected Attributes

static XrdBuffManagerBPool = 0
 
static XrdSecServiceCIA = 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 kXR_int32 myRole = kXR_isManager
 Our role. More...
 
static XrdNetPMarkpmarkHandle = 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 XrdSchedulerSched = 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 XrdOucGMapservGMap = 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
 

Detailed Description

Definition at line 79 of file XrdHttpProtocol.hh.


Class Documentation

◆ XrdHttpProtocol::StaticPreloadInfo

struct XrdHttpProtocol::StaticPreloadInfo

Definition at line 427 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.

Referenced by Match().

+ Here is the caller graph for this function:

◆ XrdHttpProtocol() [2/2]

XrdHttpProtocol::XrdHttpProtocol ( bool  imhttps)

Definition at line 191 of file XrdHttpProtocol.cc.

192 : XrdProtocol("HTTP protocol handler"), ProtLink(this),
194  myBuff = 0;
195  Addr_str = 0;
196  Reset();
197  ishttps = imhttps;
198 
199 }
XrdObject< XrdHttpProtocol > ProtLink
XrdHttpReq CurrentReq
static XrdHttpReadRangeHandler::Configuration ReadRangeConfig
configuration for the read range handler
XrdSecEntity SecEntity
Authentication area.
XrdProtocol(const char *jname)
Definition: XrdProtocol.hh:156

References Addr_str.

◆ ~XrdHttpProtocol()

XrdHttpProtocol::~XrdHttpProtocol ( )
inline

Definition at line 123 of file XrdHttpProtocol.hh.

123  {
124  Cleanup();
125  }

Member Function Documentation

◆ Configure()

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

Read and apply the configuration.

Definition at line 1694 of file XrdHttpProtocol.cc.

1694  {
1695  /*
1696  Function: Establish configuration at load time.
1697 
1698  Input: None.
1699 
1700  Output: 0 upon success or !0 otherwise.
1701  */
1702 
1703  char *rdf;
1704 
1705  // Copy out the special info we want to use at top level
1706  //
1707  eDest.logger(pi->eDest->logger());
1709  // SI = new XrdXrootdStats(pi->Stats);
1710  Sched = pi->Sched;
1711  BPool = pi->BPool;
1712  xrd_cslist = getenv("XRD_CSLIST");
1713 
1714  Port = pi->Port;
1715 
1716  // Copy out the current TLS context
1717  //
1718  xrdctx = pi->tlsCtx;
1719 
1720  {
1721  char buf[16];
1722  sprintf(buf, "%d", Port);
1723  Port_str = strdup(buf);
1724  }
1725 
1726  // Now process and configuration parameters
1727  //
1728  rdf = (parms && *parms ? parms : pi->ConfigFN);
1729  if (rdf && Config(rdf, pi->theEnv)) return 0;
1730  if (pi->DebugON) XrdHttpTrace.What = TRACE_ALL;
1731 
1732  // Set the redirect flag if we are a pure redirector
1733  myRole = kXR_isServer;
1734  if ((rdf = getenv("XRDROLE"))) {
1735  eDest.Emsg("Config", "XRDROLE: ", rdf);
1736 
1737  if (!strcasecmp(rdf, "manager") || !strcasecmp(rdf, "supervisor")) {
1739  eDest.Emsg("Config", "Configured as HTTP(s) redirector.");
1740  } else {
1741 
1742  eDest.Emsg("Config", "Configured as HTTP(s) data server.");
1743  }
1744 
1745  } else {
1746  eDest.Emsg("Config", "No XRDROLE specified.");
1747  }
1748 
1749  // Schedule protocol object cleanup
1750  //
1752  (XrdHttpTrace.What & TRACE_MEM ? TRACE_MEM : 0));
1753  ProtStack.Set((pi->ConnMax / 3 ? pi->ConnMax / 3 : 30), 60 * 60);
1754 
1755  // Return success
1756  //
1757 
1758  return 1;
1759 }
#define kXR_isManager
Definition: XProtocol.hh:1154
#define kXR_isServer
Definition: XProtocol.hh:1155
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
Definition: XrdProtocol.hh:63
XrdScheduler * Sched
Definition: XrdProtocol.hh:64
XrdTlsContext * tlsCtx
Definition: XrdProtocol.hh:99
XrdSysError * eDest
Definition: XrdProtocol.hh:61
XrdOucEnv * theEnv
Definition: XrdProtocol.hh:66
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:95
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition: XrdSysError.hh:141
void SetLogger(XrdSysLogger *logp)
Definition: XrdSysTrace.cc:65
XrdTlsContext * xrdctx

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:

◆ doChksum()

int XrdHttpProtocol::doChksum ( const XrdOucString fname)

Perform a checksum request.

Definition at line 2940 of file XrdHttpProtocol.cc.

2940  {
2941  size_t length;
2942  memset(&CurrentReq.xrdreq, 0, sizeof (ClientRequest));
2946  memset(CurrentReq.xrdreq.query.fhandle, '\0', sizeof(CurrentReq.xrdreq.query.fhandle));
2948  length = fname.length() + 1;
2949  CurrentReq.xrdreq.query.dlen = htonl(length);
2950 
2951  if (!Bridge) return -1;
2952 
2953  return Bridge->Run(reinterpret_cast<char *>(&CurrentReq.xrdreq), const_cast<char *>(fname.c_str()), length) ? 0 : -1;
2954 }
kXR_unt16 requestid
Definition: XProtocol.hh:630
kXR_char reserved1[2]
Definition: XProtocol.hh:632
kXR_unt16 infotype
Definition: XProtocol.hh:631
kXR_char reserved2[8]
Definition: XProtocol.hh:634
kXR_char fhandle[4]
Definition: XProtocol.hh:633
@ kXR_query
Definition: XProtocol.hh:113
struct ClientQueryRequest query
Definition: XProtocol.hh:864
@ kXR_Qcksum
Definition: XProtocol.hh:617
XrdXrootd::Bridge * Bridge
The Bridge that we use to exercise the xrootd internals.
ClientRequest xrdreq
The last issued xrd request, often pending.
Definition: XrdHttpReq.hh:290
const char * c_str() const
int length() 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.

Referenced by XrdHttpReq::ProcessHTTPReq().

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

◆ DoIt()

void XrdHttpProtocol::DoIt ( )
inlinevirtual

Override from the base class.

Implements XrdJob.

Definition at line 90 of file XrdHttpProtocol.hh.

90  {
91  if (Resume) (*this.*Resume)();
92  }

◆ doStat()

int XrdHttpProtocol::doStat ( char *  fname)

Perform a Stat request.

Definition at line 2912 of file XrdHttpProtocol.cc.

2912  {
2913  int l;
2914  bool b;
2915  CurrentReq.filesize = 0;
2916  CurrentReq.fileflags = 0;
2917  CurrentReq.filemodtime = 0;
2918 
2919  memset(&CurrentReq.xrdreq, 0, sizeof (ClientRequest));
2921  memset(CurrentReq.xrdreq.stat.reserved, 0,
2922  sizeof (CurrentReq.xrdreq.stat.reserved));
2923  l = strlen(fname) + 1;
2924  CurrentReq.xrdreq.stat.dlen = htonl(l);
2925 
2926  if (!Bridge) return -1;
2927  b = Bridge->Run((char *) &CurrentReq.xrdreq, fname, l);
2928  if (!b) {
2929  return -1;
2930  }
2931 
2932 
2933  return 0;
2934 }
kXR_char reserved[11]
Definition: XProtocol.hh:768
@ kXR_stat
Definition: XProtocol.hh:129
kXR_unt16 requestid
Definition: XProtocol.hh:766
struct ClientStatRequest stat
Definition: XProtocol.hh:871
kXR_int32 dlen
Definition: XProtocol.hh:770
long fileflags
Definition: XrdHttpReq.hh:306
long filemodtime
Definition: XrdHttpReq.hh:307
long long filesize
Definition: XrdHttpReq.hh:305

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:

◆ isHTTPS()

bool XrdHttpProtocol::isHTTPS ( )
inline

called via https

Definition at line 141 of file XrdHttpProtocol.hh.

141 { return ishttps; }

Referenced by XrdHttpExtReq::XrdHttpExtReq().

+ Here is the caller graph for this function:

◆ Match()

XrdProtocol * XrdHttpProtocol::Match ( XrdLink lp)
virtual

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

Implements XrdProtocol.

Definition at line 217 of file XrdHttpProtocol.cc.

217  {
218  char mybuf[16], mybuf2[1024];
219  XrdHttpProtocol *hp;
220  int dlen;
221  bool myishttps = false;
222 
223  // Peek at the first 20 bytes of data
224  //
225  if ((dlen = lp->Peek(mybuf, (int) sizeof (mybuf), hailWait)) < (int) sizeof (mybuf)) {
226  if (dlen <= 0) lp->setEtext("handshake not received");
227  return (XrdProtocol *) 0;
228  }
229  mybuf[dlen - 1] = '\0';
230 
231  // Trace the data
232  //
233 
234  TRACEI(DEBUG, "received dlen: " << dlen);
235  //TRACEI(REQ, "received buf: " << mybuf);
236  mybuf2[0] = '\0';
237  for (int i = 0; i < dlen; i++) {
238  char mybuf3[16];
239  sprintf(mybuf3, "%.02d ", mybuf[i]);
240  strcat(mybuf2, mybuf3);
241 
242  }
243  TRACEI(DEBUG, "received dump: " << mybuf2);
244 
245  // Decide if it looks http or not. For now we are happy if all the received characters are alphanumeric
246  bool ismine = true;
247  for (int i = 0; i < dlen - 1; i++)
248  if (!isprint(mybuf[i]) && (mybuf[i] != '\r') && (mybuf[i] != '\n')) {
249  ismine = false;
250  TRACEI(DEBUG, "This does not look like http at pos " << i);
251  break;
252  }
253 
254  // If it does not look http then look if it looks like https
255  if ((!ismine) && (dlen >= 4)) {
256  char check[4] = {00, 00, 00, 00};
257  if (memcmp(mybuf, check, 4)) {
258 
259  if (httpsmode) {
260  ismine = true;
261  myishttps = true;
262  TRACEI(DEBUG, "This may look like https");
263  } else {
264  TRACEI(ALL, "This may look like https, but https is not configured");
265  }
266 
267  }
268  }
269 
270  if (!ismine) {
271  TRACEI(DEBUG, "This does not look like https. Protocol not matched.");
272  return (XrdProtocol *) 0;
273  }
274 
275  // It does look http or https...
276  // Get a protocol object off the stack (if none, allocate a new one)
277  //
278 
279  TRACEI(REQ, "Protocol matched. https: " << myishttps);
280  if (!(hp = ProtStack.Pop())) hp = new XrdHttpProtocol(myishttps);
281  else
282  hp->ishttps = myishttps;
283 
284  // We now have to do some work arounds to tell the underlying framework
285  // that is is https without invoking TLS on the actual link. Eventually,
286  // we should just use the link's TLS native implementation.
287  //
288  hp->SecEntity.addrInfo = lp->AddrInfo();
289  XrdNetAddr *netP = const_cast<XrdNetAddr*>(lp->NetAddr());
290  netP->SetDialect("https");
291  netP->SetTLS(true);
292 
293  // Allocate 1MB buffer from pool
294  if (!hp->myBuff) {
295  hp->myBuff = BPool->Obtain(1024 * 1024);
296  }
297  hp->myBuffStart = hp->myBuffEnd = hp->myBuff->buff;
298 
299  // Bind the protocol to the link and return the protocol
300  //
301  hp->Link = lp;
302  return (XrdProtocol *) hp;
303 }
#define DEBUG(x)
Definition: XrdBwmTrace.hh:54
#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)
Definition: XrdNetAddr.hh:205
void SetTLS(bool val)
Definition: XrdNetAddr.cc:582
T * Pop()
Definition: XrdObject.hh:93
XrdNetAddrInfo * addrInfo
Entity's connection details.
Definition: XrdSecEntity.hh:80

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:

◆ operator=()

XrdHttpProtocol XrdHttpProtocol::operator= ( const XrdHttpProtocol rhs)

Definition at line 206 of file XrdHttpProtocol.cc.

206  {
207 
208  return *this;
209 }

◆ 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 1764 of file XrdHttpProtocol.cc.

1764  {
1765  char *val, keybuf[1024], parmbuf[1024];
1766  char *parm;
1767 
1768  // Get the header key
1769  val = Config.GetWord();
1770  if (!val || !val[0]) {
1771  err.Emsg("Config", "No headerkey specified.");
1772  return 1;
1773  } else {
1774 
1775  // Trim the beginning, in place
1776  while ( *val && !isalnum(*val) ) val++;
1777  strcpy(keybuf, val);
1778 
1779  // Trim the end, in place
1780  char *pp;
1781  pp = keybuf + strlen(keybuf) - 1;
1782  while ( (pp >= keybuf) && (!isalnum(*pp)) ) {
1783  *pp = '\0';
1784  pp--;
1785  }
1786 
1787  parm = Config.GetWord();
1788 
1789  // Avoids segfault in case a key is given without value
1790  if(!parm || !parm[0]) {
1791  err.Emsg("Config", "No header2cgi value specified. key: '", keybuf, "'");
1792  return 1;
1793  }
1794 
1795  // Trim the beginning, in place
1796  while ( *parm && !isalnum(*parm) ) parm++;
1797  strcpy(parmbuf, parm);
1798 
1799  // Trim the end, in place
1800  pp = parmbuf + strlen(parmbuf) - 1;
1801  while ( (pp >= parmbuf) && (!isalnum(*pp)) ) {
1802  *pp = '\0';
1803  pp--;
1804  }
1805 
1806  // Add this mapping to the map that will be used
1807  try {
1808  header2cgi[keybuf] = parmbuf;
1809  } catch ( ... ) {
1810  err.Emsg("Config", "Can't insert new header2cgi rule. key: '", keybuf, "'");
1811  return 1;
1812  }
1813 
1814  }
1815  return 0;
1816 }
XrdCmsConfig Config

References XrdCms::Config, and XrdSysError::Emsg().

+ 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 479 of file XrdHttpProtocol.cc.

480 {
481  int rc = 0;
482 
483  TRACEI(DEBUG, " Process. lp:"<<(void *)lp<<" reqstate: "<<CurrentReq.reqstate);
484 
485  if (!myBuff || !myBuff->buff || !myBuff->bsize) {
486  TRACE(ALL, " Process. No buffer available. Internal error.");
487  return -1;
488  }
489 
490 
491  if (!SecEntity.host) {
492  char *nfo = GetClientIPStr();
493  if (nfo) {
494  TRACEI(REQ, " Setting host: " << nfo);
495  SecEntity.host = nfo;
496  strcpy(SecEntity.prot, "http");
497  }
498  }
499 
500 
501 
502  // If https then check independently for the ssl handshake
503  if (ishttps && !ssldone) {
504 
505  if (!ssl) {
506  sbio = CreateBIO(Link);
507  BIO_set_nbio(sbio, 1);
508  ssl = (SSL*)xrdctx->Session();
509  }
510 
511  if (!ssl) {
512  TRACEI(DEBUG, " SSL_new returned NULL");
513  ERR_print_errors(sslbio_err);
514  return -1;
515  }
516 
517  // If a secxtractor has been loaded
518  // maybe it wants to add its own initialization bits
519  if (secxtractor)
520  secxtractor->InitSSL(ssl, sslcadir);
521 
522  SSL_set_bio(ssl, sbio, sbio);
523  //SSL_set_connect_state(ssl);
524 
525  //SSL_set_fd(ssl, Link->FDnum());
526  struct timeval tv;
527  tv.tv_sec = 10;
528  tv.tv_usec = 0;
529  setsockopt(Link->FDnum(), SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)&tv, sizeof(struct timeval));
530  setsockopt(Link->FDnum(), SOL_SOCKET, SO_SNDTIMEO, (struct timeval *)&tv, sizeof(struct timeval));
531 
532  TRACEI(DEBUG, " Entering SSL_accept...");
533  int res = SSL_accept(ssl);
534  TRACEI(DEBUG, " SSL_accept returned :" << res);
535  if ((res == -1) && (SSL_get_error(ssl, res) == SSL_ERROR_WANT_READ)) {
536  TRACEI(DEBUG, " SSL_accept wants to read more bytes... err:" << SSL_get_error(ssl, res));
537  return 1;
538  }
539 
540  if(res <= 0) {
541  ERR_print_errors(sslbio_err);
542  if (res < 0) {
543 
544  SSL_free(ssl);
545  ssl = 0;
546  return -1;
547  }
548  }
549 
550  BIO_set_nbio(sbio, 0);
551 
552  strcpy(SecEntity.prot, "https");
553 
554  // Get the voms string and auth information
555  if (HandleAuthentication(Link)) {
556  SSL_free(ssl);
557  ssl = 0;
558  return -1;
559  }
560 
561  ssldone = true;
562  if (TRACING(TRACE_AUTH)) {
564  }
565  }
566 
567 
568 
569  if (!DoingLogin) {
570  // Re-invocations triggered by the bridge have lp==0
571  // In this case we keep track of a different request state
572  if (lp) {
573 
574  // This is an invocation that was triggered by a socket event
575  // Read all the data that is available, throw it into the buffer
576  if ((rc = getDataOneShot(BuffAvailable())) < 0) {
577  // Error -> exit
578  return -1;
579  }
580 
581  // If we need more bytes, let's wait for another invokation
582  if (BuffUsed() < ResumeBytes) return 1;
583 
584 
585  } else
587  } else if (!DoneSetInfo && !CurrentReq.userAgent().empty()) { // DoingLogin is true, meaning the login finished.
588  std::string mon_info = "monitor info " + CurrentReq.userAgent();
589  DoneSetInfo = true;
590  if (mon_info.size() >= 1024) {
591  TRACEI(ALL, "User agent string too long");
592  } else if (!Bridge) {
593  TRACEI(ALL, "Internal logic error: Bridge is null after login");
594  } else {
595  TRACEI(DEBUG, "Setting " << mon_info);
596  memset(&CurrentReq.xrdreq, 0, sizeof (ClientRequest));
598  CurrentReq.xrdreq.set.modifier = '\0';
599  memset(CurrentReq.xrdreq.set.reserved, '\0', sizeof(CurrentReq.xrdreq.set.reserved));
600  CurrentReq.xrdreq.set.dlen = htonl(mon_info.size());
601  if (!Bridge->Run((char *) &CurrentReq.xrdreq, (char *) mon_info.c_str(), mon_info.size())) {
602  SendSimpleResp(500, nullptr, nullptr, "Could not set user agent.", 0, false);
603  return -1;
604  }
605  return 0;
606  }
607  } else {
608  DoingLogin = false;
609  }
610 
611  // Read the next request header, that is, read until a double CRLF is found
612 
613 
614  if (!CurrentReq.headerok) {
615 
616  // Read as many lines as possible into the buffer. An empty line breaks
617  while ((rc = BuffgetLine(tmpline)) > 0) {
618  if (TRACING(TRACE_DEBUG)) {
619  std::string traceLine{tmpline.c_str()};
620  traceLine = XrdOucUtils::obfuscate(traceLine, {"authorization", "transferheaderauthorization"}, ':', '\n');
621  TRACE(DEBUG, " rc:" << rc << " got hdr line: " << traceLine);
622  }
623  if ((rc == 2) && (tmpline.length() > 1) && (tmpline[rc - 1] == '\n')) {
624  CurrentReq.headerok = true;
625  TRACE(DEBUG, " rc:" << rc << " detected header end.");
626  break;
627  }
628 
629 
631  TRACE(DEBUG, " Parsing first line: " << tmpline.c_str());
632  int result = CurrentReq.parseFirstLine((char *)tmpline.c_str(), rc);
633  if (result < 0) {
634  TRACE(DEBUG, " Parsing of first line failed with " << result);
635  return -1;
636  }
637  } else {
638  int result = CurrentReq.parseLine((char *) tmpline.c_str(), rc);
639  if(result < 0) {
640  TRACE(DEBUG, " Parsing of header line failed with " << result)
641  SendSimpleResp(400,NULL,NULL,"Malformed header line. Hint: ensure the line finishes with \"\\r\\n\"", 0, false);
642  return -1;
643  }
644  }
645 
646 
647  }
648 
649  // Here we have CurrentReq loaded with the header, or its relevant fields
650 
651  if (!CurrentReq.headerok) {
652  TRACEI(REQ, " rc:" << rc << "Header not yet complete.");
653 
654  // Here a subtle error condition. IF we failed reading a line AND the buffer
655  // has a reasonable amount of data available THEN we consider the header
656  // as corrupted and shutdown the client
657  if ((rc <= 0) && (BuffUsed() >= 16384)) {
658  TRACEI(ALL, "Corrupted header detected, or line too long. Disconnecting client.");
659  return -1;
660  }
661 
662 
663  if (CurrentReq.reqstate > 0)
665  // Waiting for more data
666  return 1;
667  }
668 
669  }
670 
671  // If we are in self-redirect mode, then let's do it
672  // Do selfredirect only with 'simple' requests, otherwise poor clients may misbehave
673  if (ishttps && ssldone && selfhttps2http &&
676  char hash[512];
677  time_t timenow = time(0);
678 
679 
681  &SecEntity,
682  timenow,
683  secretkey);
684 
685 
686 
687  if (hash[0]) {
688 
689  // Workaround... delete the previous opaque information
690  if (CurrentReq.opaque) {
691  delete CurrentReq.opaque;
692  CurrentReq.opaque = 0;
693  }
694 
695  TRACEI(REQ, " rc:" << rc << " self-redirecting to http with security token.");
696 
697  XrdOucString dest = "Location: http://";
698  // Here I should put the IP addr of the server
699 
700  // We have to recompute it here because we don't know to which
701  // interface the client had connected to
702  struct sockaddr_storage sa;
703  socklen_t sl = sizeof(sa);
704  getsockname(this->Link->AddrInfo()->SockFD(), (struct sockaddr*)&sa, &sl);
705 
706  // now get it back and print it
707  char buf[256];
708  bool ok = false;
709 
710  switch (sa.ss_family) {
711  case AF_INET:
712  if (inet_ntop(AF_INET, &(((sockaddr_in*)&sa)->sin_addr), buf, INET_ADDRSTRLEN)) {
713  if (Addr_str) free(Addr_str);
714  Addr_str = strdup(buf);
715  ok = true;
716  }
717  break;
718  case AF_INET6:
719  if (inet_ntop(AF_INET6, &(((sockaddr_in6*)&sa)->sin6_addr), buf, INET6_ADDRSTRLEN)) {
720  if (Addr_str) free(Addr_str);
721  Addr_str = (char *)malloc(strlen(buf)+3);
722  strcpy(Addr_str, "[");
723  strcat(Addr_str, buf);
724  strcat(Addr_str, "]");
725  ok = true;
726  }
727  break;
728  default:
729  TRACEI(REQ, " Can't recognize the address family of the local host.");
730  }
731 
732  if (ok) {
733  dest += Addr_str;
734  dest += ":";
735  dest += Port_str;
736  dest += CurrentReq.resource.c_str();
737  TRACEI(REQ," rc:"<<rc<<" self-redirecting to http with security token: '"
738  << dest.c_str() << "'");
739 
740 
741  CurrentReq.appendOpaque(dest, &SecEntity, hash, timenow);
742  SendSimpleResp(302, NULL, (char *) dest.c_str(), 0, 0, true);
743  CurrentReq.reset();
744  return -1;
745  }
746 
747  TRACEI(REQ, " rc:" << rc << " Can't perform self-redirection.");
748 
749  }
750  else {
751  TRACEI(ALL, " Could not calculate self-redirection hash");
752  }
753  }
754 
755  // If this is not https, then extract the signed information from the url
756  // and fill the SecEntity structure as if we were using https
757  if (!ishttps && !ssldone) {
758 
759 
760  if (CurrentReq.opaque) {
761  char * tk = CurrentReq.opaque->Get("xrdhttptk");
762  // If there is a hash then we use it as authn info
763  if (tk) {
764 
765  time_t tim = 0;
766  char * t = CurrentReq.opaque->Get("xrdhttptime");
767  if (t) tim = atoi(t);
768  if (!t) {
769  TRACEI(REQ, " xrdhttptime not specified. Authentication failed.");
770  return -1;
771  }
772  if (abs(time(0) - tim) > XRHTTP_TK_GRACETIME) {
773  TRACEI(REQ, " Token expired. Authentication failed.");
774  return -1;
775  }
776 
777  // Fill the Secentity from the fields in the URL:name, vo, host
778  char *nfo;
779 
780  nfo = CurrentReq.opaque->Get("xrdhttpvorg");
781  if (nfo) {
782  TRACEI(DEBUG, " Setting vorg: " << nfo);
783  SecEntity.vorg = strdup(nfo);
784  TRACEI(REQ, " Setting vorg: " << SecEntity.vorg);
785  }
786 
787  nfo = CurrentReq.opaque->Get("xrdhttpname");
788  if (nfo) {
789  TRACEI(DEBUG, " Setting name: " << nfo);
790  SecEntity.name = unquote(nfo);
791  TRACEI(REQ, " Setting name: " << SecEntity.name);
792  }
793 
794  nfo = CurrentReq.opaque->Get("xrdhttphost");
795  if (nfo) {
796  TRACEI(DEBUG, " Setting host: " << nfo);
797  if (SecEntity.host) free(SecEntity.host);
798  SecEntity.host = unquote(nfo);
799  TRACEI(REQ, " Setting host: " << SecEntity.host);
800  }
801 
802  nfo = CurrentReq.opaque->Get("xrdhttpdn");
803  if (nfo) {
804  TRACEI(DEBUG, " Setting dn: " << nfo);
805  SecEntity.moninfo = unquote(nfo);
806  TRACEI(REQ, " Setting dn: " << SecEntity.moninfo);
807  }
808 
809  nfo = CurrentReq.opaque->Get("xrdhttprole");
810  if (nfo) {
811  TRACEI(DEBUG, " Setting role: " << nfo);
812  SecEntity.role = unquote(nfo);
813  TRACEI(REQ, " Setting role: " << SecEntity.role);
814  }
815 
816  nfo = CurrentReq.opaque->Get("xrdhttpgrps");
817  if (nfo) {
818  TRACEI(DEBUG, " Setting grps: " << nfo);
819  SecEntity.grps = unquote(nfo);
820  TRACEI(REQ, " Setting grps: " << SecEntity.grps);
821  }
822 
823  nfo = CurrentReq.opaque->Get("xrdhttpendorsements");
824  if (nfo) {
825  TRACEI(DEBUG, " Setting endorsements: " << nfo);
827  TRACEI(REQ, " Setting endorsements: " << SecEntity.endorsements);
828  }
829 
830  nfo = CurrentReq.opaque->Get("xrdhttpcredslen");
831  if (nfo) {
832  TRACEI(DEBUG, " Setting credslen: " << nfo);
833  char *s1 = unquote(nfo);
834  if (s1 && s1[0]) {
835  SecEntity.credslen = atoi(s1);
836  TRACEI(REQ, " Setting credslen: " << SecEntity.credslen);
837  }
838  if (s1) free(s1);
839  }
840 
841  if (SecEntity.credslen) {
842  nfo = CurrentReq.opaque->Get("xrdhttpcreds");
843  if (nfo) {
844  TRACEI(DEBUG, " Setting creds: " << nfo);
845  SecEntity.creds = unquote(nfo);
846  TRACEI(REQ, " Setting creds: " << SecEntity.creds);
847  }
848  }
849 
850  char hash[512];
851 
853  &SecEntity,
854  tim,
855  secretkey);
856 
857  if (compareHash(hash, tk)) {
858  TRACEI(REQ, " Invalid tk '" << tk << "' != '" << hash << "'(calculated). Authentication failed.");
859  return -1;
860  }
861 
862  } else {
863  // Client is plain http. If we have a secret key then we reject it
864  if (secretkey) {
865  TRACEI(ALL, " Rejecting plain http with no valid token as we have a secretkey.");
866  return -1;
867  }
868  }
869 
870  } else {
871  // Client is plain http. If we have a secret key then we reject it
872  if (secretkey) {
873  TRACEI(ALL, " Rejecting plain http with no valid token as we have a secretkey.");
874  return -1;
875  }
876  }
877 
878  ssldone = true;
879  }
880 
881 
882 
883  // Now we have everything that is needed to try the login
884  // Remember that if there is an exthandler then it has the responsibility
885  // for authorization in the paths that it manages
886  if (!Bridge && !FindMatchingExtHandler(CurrentReq)) {
887  if (SecEntity.name)
888  Bridge = XrdXrootd::Bridge::Login(&CurrentReq, Link, &SecEntity, SecEntity.name, ishttps ? "https" : "http");
889  else
890  Bridge = XrdXrootd::Bridge::Login(&CurrentReq, Link, &SecEntity, "unknown", ishttps ? "https" : "http");
891 
892  if (!Bridge) {
893  TRACEI(REQ, " Authorization failed.");
894  return -1;
895  }
896 
897  // Let the bridge process the login, and then reinvoke us
898  DoingLogin = true;
899  return 0;
900  }
901 
902  // Compute and send the response. This may involve further reading from the socket
903  rc = CurrentReq.ProcessHTTPReq();
904  if (rc < 0)
905  CurrentReq.reset();
906 
907 
908 
909  TRACEI(REQ, "Process is exiting rc:" << rc);
910  return rc;
911 }
struct ClientSetRequest set
Definition: XProtocol.hh:869
@ kXR_set
Definition: XProtocol.hh:130
kXR_unt16 requestid
Definition: XProtocol.hh:717
kXR_int32 dlen
Definition: XProtocol.hh:720
kXR_char modifier
Definition: XProtocol.hh:719
kXR_char reserved[15]
Definition: XProtocol.hh:718
short kXR_int16
Definition: XPtypes.hh:66
#define XRHTTP_TK_GRACETIME
#define TRACE_AUTH
Definition: XrdHttpTrace.hh:48
int compareHash(const char *h1, const char *h2)
char * unquote(char *str)
void calcHashes(char *hash, const char *fn, kXR_int16 request, XrdSecEntity *secent, time_t tim, const char *key)
#define TRACE_DEBUG
Definition: XrdTrace.hh:36
#define TRACE(act, x)
Definition: XrdTrace.hh:63
#define TRACING(x)
Definition: XrdTrace.hh:70
int bsize
Definition: XrdBuffer.hh:46
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.
Definition: XrdHttpReq.hh:316
XrdOucString resource
The resource specified by the request, stripped of opaque data.
Definition: XrdHttpReq.hh:240
bool headerok
Tells if we have finished reading the header.
Definition: XrdHttpReq.hh:248
ReqType request
The request we got.
Definition: XrdHttpReq.hh:232
int ProcessHTTPReq()
Definition: XrdHttpReq.cc:926
XrdOucEnv * opaque
The opaque data, after parsing.
Definition: XrdHttpReq.hh:242
int parseFirstLine(char *line, int len)
Parse the first line of the header.
Definition: XrdHttpReq.cc:255
int parseLine(char *line, int len)
Parse the header.
Definition: XrdHttpReq.cc:115
void appendOpaque(XrdOucString &s, XrdSecEntity *secent, char *hash, time_t tnow)
Definition: XrdHttpReq.cc:627
const std::string & userAgent() const
Definition: XrdHttpReq.hh:206
virtual void reset()
Definition: XrdHttpReq.cc:2710
virtual int InitSSL(SSL *, char *)
char * Get(const char *varname)
Definition: XrdOucEnv.hh:69
static std::string obfuscate(const std::string &input, const std::unordered_set< std::string > &keysToObfuscate, const char keyValueDelimiter, const char listDelimiter)
char * vorg
Entity's virtual organization(s)
Definition: XrdSecEntity.hh:71
int credslen
Length of the 'creds' data.
Definition: XrdSecEntity.hh:78
char prot[XrdSecPROTOIDSIZE]
Auth protocol used (e.g. krb5)
Definition: XrdSecEntity.hh:67
char * creds
Raw entity credentials or cert.
Definition: XrdSecEntity.hh:77
char * grps
Entity's group name(s)
Definition: XrdSecEntity.hh:73
char * name
Entity's name.
Definition: XrdSecEntity.hh:69
char * role
Entity's role(s)
Definition: XrdSecEntity.hh:72
char * endorsements
Protocol specific endorsements.
Definition: XrdSecEntity.hh:75
void Display(XrdSysError &mDest)
Definition: XrdSecEntity.cc:58
char * moninfo
Information for monitoring.
Definition: XrdSecEntity.hh:76
char * host
Entity's host name dnr dependent.
Definition: XrdSecEntity.hh:70
void * Session()
static Bridge * Login(Result *rsltP, XrdLink *linkP, XrdSecEntity *seceP, const char *nameP, const char *protP)

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, XrdOucUtils::obfuscate(), 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, XrdNetAddrInfo::SockFD(), sslcadir, TRACE, TRACE_AUTH, TRACE_DEBUG, TRACEI, TRACING, unquote(), 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 919 of file XrdHttpProtocol.cc.

919  {
920 
921  // Release all appendages
922  //
923 
924  Cleanup();
925 
926 
927  // Set fields to starting point (debugging mostly)
928  //
929  Reset();
930 
931  // Push ourselves on the stack
932  //
934 }
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 936 of file XrdHttpProtocol.cc.

936  {
937  // Synchronize statistics if need be
938  //
939  // if (do_sync) {
940  //
941  // SI->statsMutex.Lock();
942  // SI->readCnt += numReads;
943  // cumReads += numReads;
944  // numReads = 0;
945  // SI->prerCnt += numReadP;
946  // cumReadP += numReadP;
947  // numReadP = 0;
948  // SI->rvecCnt += numReadV;
949  // cumReadV += numReadV;
950  // numReadV = 0;
951  // SI->rsegCnt += numSegsV;
952  // cumSegsV += numSegsV;
953  // numSegsV = 0;
954  // SI->writeCnt += numWrites;
955  // cumWrites += numWrites;
956  // numWrites = 0;
957  // SI->statsMutex.UnLock();
958  // }
959  //
960  // // Now return the statistics
961  // //
962  // return SI->Stats(buff, blen, do_sync);
963 
964  return 0;
965 }

Friends And Related Function Documentation

◆ XrdHttpExtReq

friend class XrdHttpExtReq
friend

Definition at line 82 of file XrdHttpProtocol.hh.

◆ XrdHttpReq

friend class XrdHttpReq
friend

Definition at line 81 of file XrdHttpProtocol.hh.

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 361 of file XrdHttpProtocol.hh.

Referenced by XrdHttpProtocol(), and Process().

◆ BPool

XrdBuffManager * XrdHttpProtocol::BPool = 0
staticprotected

Definition at line 352 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 367 of file XrdHttpProtocol.hh.

Referenced by doChksum(), doStat(), Process(), and XrdHttpReq::ProcessHTTPReq().

◆ CIA

XrdSecService * XrdHttpProtocol::CIA = 0
staticprotected

Definition at line 354 of file XrdHttpProtocol.hh.

◆ cksumHandler

XrdHttpChecksumHandler XrdHttpProtocol::cksumHandler = XrdHttpChecksumHandler()
static

Definition at line 135 of file XrdHttpProtocol.hh.

Referenced by XrdHttpReq::ProcessHTTPReq().

◆ compatNameGeneration

bool XrdHttpProtocol::compatNameGeneration = false
staticprotected

Definition at line 400 of file XrdHttpProtocol.hh.

◆ crlRefIntervalSec

int XrdHttpProtocol::crlRefIntervalSec = XrdTlsContext::DEFAULT_CRL_REF_INT_SEC
staticprotected

CRL thread refresh interval.

Definition at line 395 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 372 of file XrdHttpProtocol.hh.

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

◆ eDest

XrdSysError XrdHttpProtocol::eDest = 0
staticprotected

Definition at line 353 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 421 of file XrdHttpProtocol.hh.

Referenced by XrdHttpReq::ProcessHTTPReq().

◆ gridmap

char * XrdHttpProtocol::gridmap = 0
staticprotected

Gridmap file location. The same used by XrdSecGsi.

Definition at line 398 of file XrdHttpProtocol.hh.

◆ hailWait

int XrdHttpProtocol::hailWait = 60000
staticprotected

Timeout for reading the handshake.

Definition at line 380 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 437 of file XrdHttpProtocol.hh.

Referenced by XrdHttpReq::parseLine().

◆ isdesthttps

bool XrdHttpProtocol::isdesthttps = false
staticprotected

True if the redirections must be towards https targets.

Definition at line 409 of file XrdHttpProtocol.hh.

Referenced by XrdHttpReq::Redir().

◆ isRequiredGridmap

bool XrdHttpProtocol::isRequiredGridmap = false
staticprotected

Definition at line 399 of file XrdHttpProtocol.hh.

◆ Link

XrdLink* XrdHttpProtocol::Link
protected

The link we are bound to.

Definition at line 357 of file XrdHttpProtocol.hh.

Referenced by XrdHttpExtReq::GetClientID(), Match(), and Process().

◆ listdeny

bool XrdHttpProtocol::listdeny = false
staticprotected

If true, any form of listing is denied.

Definition at line 415 of file XrdHttpProtocol.hh.

Referenced by XrdHttpReq::ProcessHTTPReq().

◆ listredir

char * XrdHttpProtocol::listredir = 0
staticprotected

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

Definition at line 412 of file XrdHttpProtocol.hh.

Referenced by XrdHttpReq::ProcessHTTPReq().

◆ m_bio_method

BIO_METHOD * XrdHttpProtocol::m_bio_method = NULL
staticprotected

C-style vptr table for our custom BIO objects.

Definition at line 443 of file XrdHttpProtocol.hh.

◆ m_bio_type

int XrdHttpProtocol::m_bio_type = 0
staticprotected

Type identifier for our custom BIO objects.

Definition at line 440 of file XrdHttpProtocol.hh.

◆ myRole

kXR_int32 XrdHttpProtocol::myRole = kXR_isManager
staticprotected

Our role.

Definition at line 434 of file XrdHttpProtocol.hh.

Referenced by Configure(), and XrdHttpReq::ProcessHTTPReq().

◆ pmarkHandle

XrdNetPMark * XrdHttpProtocol::pmarkHandle = nullptr
staticprotected

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

Definition at line 449 of file XrdHttpProtocol.hh.

Referenced by XrdHttpExtReq::XrdHttpExtReq(), and XrdHttpReq::parseLine().

◆ Port

int XrdHttpProtocol::Port = 1094
staticprotected

Our port.

Definition at line 386 of file XrdHttpProtocol.hh.

Referenced by Configure().

◆ Port_str

char * XrdHttpProtocol::Port_str = 0
staticprotected

Our port, as a string.

Definition at line 389 of file XrdHttpProtocol.hh.

Referenced by Configure(), and Process().

◆ ProtLink

XrdObject<XrdHttpProtocol> XrdHttpProtocol::ProtLink

Definition at line 128 of file XrdHttpProtocol.hh.

Referenced by Recycle().

◆ ProtStack

XrdObjectQ< XrdHttpProtocol > XrdHttpProtocol::ProtStack
static

Definition at line 127 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 138 of file XrdHttpProtocol.hh.

◆ readWait

int XrdHttpProtocol::readWait = 300000
staticprotected

Timeout for reading data.

Definition at line 383 of file XrdHttpProtocol.hh.

◆ Sched

XrdScheduler * XrdHttpProtocol::Sched = 0
staticprotected

Definition at line 351 of file XrdHttpProtocol.hh.

Referenced by Configure().

◆ SecEntity

XrdSecEntity XrdHttpProtocol::SecEntity

Authentication area.

Definition at line 132 of file XrdHttpProtocol.hh.

Referenced by XrdHttpExtReq::XrdHttpExtReq(), XrdHttpExtReq::GetSecEntity(), Match(), Process(), and XrdHttpReq::Redir().

◆ secretkey

char * XrdHttpProtocol::secretkey = 0
staticprotected

The key used to calculate the url hashes.

Definition at line 403 of file XrdHttpProtocol.hh.

Referenced by Process(), and XrdHttpReq::Redir().

◆ selfhttps2http

bool XrdHttpProtocol::selfhttps2http = false
staticprotected

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

Definition at line 418 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 364 of file XrdHttpProtocol.hh.

◆ sslcadir

char * XrdHttpProtocol::sslcadir = 0
staticprotected

Definition at line 392 of file XrdHttpProtocol.hh.

Referenced by Process().

◆ sslcafile

char * XrdHttpProtocol::sslcafile = 0
staticprotected

Definition at line 392 of file XrdHttpProtocol.hh.

◆ sslcert

char * XrdHttpProtocol::sslcert = 0
staticprotected

OpenSSL stuff.

Definition at line 392 of file XrdHttpProtocol.hh.

◆ sslcipherfilter

char * XrdHttpProtocol::sslcipherfilter = 0
staticprotected

Definition at line 392 of file XrdHttpProtocol.hh.

◆ sslkey

char * XrdHttpProtocol::sslkey = 0
staticprotected

Definition at line 392 of file XrdHttpProtocol.hh.

◆ sslverifydepth

int XrdHttpProtocol::sslverifydepth = 9
staticprotected

Depth of verification of a certificate chain.

Definition at line 406 of file XrdHttpProtocol.hh.

◆ staticpreload

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

Definition at line 431 of file XrdHttpProtocol.hh.

Referenced by XrdHttpReq::ProcessHTTPReq().

◆ staticredir

char * XrdHttpProtocol::staticredir = 0
staticprotected

Definition at line 424 of file XrdHttpProtocol.hh.

Referenced by XrdHttpReq::ProcessHTTPReq().

◆ tpcForwardCreds

bool XrdHttpProtocol::tpcForwardCreds = false
staticprotected

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

Definition at line 452 of file XrdHttpProtocol.hh.

Referenced by XrdHttpExtReq::XrdHttpExtReq().

◆ 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 446 of file XrdHttpProtocol.hh.

Referenced by Configure().


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