Loading...
Searching...
No Matches
XrdHttpProtocol.cc File Reference
`#include "XrdVersion.hh"`
`#include "Xrd/XrdBuffer.hh"`
`#include "Xrd/XrdLink.hh"`
`#include "XProtocol/XProtocol.hh"`
`#include "XrdOuc/XrdOuca2x.hh"`
`#include "XrdOuc/XrdOucStream.hh"`
`#include "XrdOuc/XrdOucEnv.hh"`
`#include "XrdOuc/XrdOucGMap.hh"`
`#include "XrdSys/XrdSysE2T.hh"`
`#include "XrdSys/XrdSysTimer.hh"`
`#include "XrdOuc/XrdOucPinLoader.hh"`
`#include "XrdHttpTrace.hh"`
`#include "XrdHttpProtocol.hh"`
`#include <sys/stat.h>`
`#include "XrdHttpUtils.hh"`
`#include "XrdHttpSecXtractor.hh"`
`#include "XrdHttpExtHandler.hh"`
`#include "XrdTls/XrdTls.hh"`
`#include "XrdTls/XrdTlsContext.hh"`
`#include "XrdOuc/XrdOucUtils.hh"`
`#include "XrdOuc/XrdOucPrivateUtils.hh"`
`#include "XrdHttpCors/XrdHttpCors.hh"`
`#include <charconv>`
`#include <openssl/err.h>`
`#include <openssl/ssl.h>`
`#include <vector>`
`#include <arpa/inet.h>`
`#include <sstream>`
`#include <cctype>`
`#include <fcntl.h>`
`#include <algorithm>`
Include dependency graph for XrdHttpProtocol.cc:

Go to the source code of this file.

## Namespaces

namespace | XrdHttpProtoInfo

## Macros

#define | HTTPS_ALERT(x, y, z)
#define | TRACELINK Link
#define | TRACELINK Link
#define | TRACELINK lp
#define | TS_Xeq(x, m)
#define | TS_Xeq3(x, m)
#define | XRHTTP_TK_GRACETIME 600

## Functions

void * | BIO_get_data (BIO *bio)
int | BIO_get_flags (BIO *bio)
int | BIO_get_init (BIO *bio)
int | BIO_get_shutdown (BIO *bio)
void | BIO_set_data (BIO *bio, void *ptr)
void | BIO_set_flags (BIO *bio, int flags)
void | BIO_set_init (BIO *bio, int init)
void | BIO_set_shutdown (BIO *bio, int shut)
static int | BIO_XrdLink_create (BIO *bio)
static long | BIO_XrdLink_ctrl (BIO *bio, int cmd, long num, void *ptr)
static int | BIO_XrdLink_destroy (BIO *bio)
static int | BIO_XrdLink_read (BIO *bio, char *data, size_t datal, size_t *read)
int | BIO_XrdLink_write (BIO *bio, const char *data, size_t datal, size_t *written)
static | XrdVERSIONINFODEF (compiledVer, XrdHttpProtocolTest, XrdVNUMBER, XrdVERSION)

## Variables

static const int | XrdHttpProtoInfo::hsmAuto = -1
static const int | XrdHttpProtoInfo::hsmMan = 1
static const int | XrdHttpProtoInfo::hsmOff = 0
static const int | XrdHttpProtoInfo::hsmOn = 1
int | XrdHttpProtoInfo::httpsmode = hsmAuto
bool | XrdHttpProtoInfo::httpsspec = false
int | XrdHttpProtoInfo::tlsCache = XrdTlsContext::scOff
bool | XrdHttpProtoInfo::tlsClientAuth = true
XrdTlsContext * | XrdHttpProtoInfo::xrdctx = 0
bool | XrdHttpProtoInfo::xrdctxVer = false
const char * | XrdHttpSecEntityTident = "http"
XrdSysTrace | XrdHttpTrace ("http")

## Macro Definition Documentation

## HTTPS_ALERT

#define HTTPS_ALERT | ( |  | x,
|  |  | y,
|  |  | z )

Value:
httpsspec = true;\
if (xrdctx && httpsmode == hsmAuto && (z || xrdctx->x509Verify())) \
eDest.Say("Config http." x " overrides the xrd." y " directive.")
eDest
static XrdSysError eDest(0,"crypto_")
XrdHttpProtoInfo::httpsmode
int httpsmode
Definition XrdHttpProtocol.cc:146
XrdHttpProtoInfo::httpsspec
bool httpsspec
Definition XrdHttpProtocol.cc:149
XrdHttpProtoInfo::hsmAuto
static const int hsmAuto
Definition XrdHttpProtocol.cc:141
XrdHttpProtoInfo::xrdctx
XrdTlsContext * xrdctx
Definition XrdHttpProtocol.cc:139

Definition at line 988 of file XrdHttpProtocol.cc.

#define HTTPS_ALERT(x,y,z) httpsspec = true;\
if (xrdctx && httpsmode == hsmAuto && (z || xrdctx->x509Verify())) \
eDest.Say("Config http." x " overrides the xrd." y " directive.")

## TRACELINK [1/3]

#define TRACELINK Link

Definition at line 227 of file XrdHttpProtocol.cc.

## TRACELINK [2/3]

#define TRACELINK Link

Definition at line 227 of file XrdHttpProtocol.cc.

## TRACELINK [3/3]

#define TRACELINK lp

Definition at line 227 of file XrdHttpProtocol.cc.

## TS_Xeq

#define TS_Xeq | ( |  | x,
|  |  | m )

Value:
(!strcmp(x,var)) GoNo = m(Config)

Definition at line 984 of file XrdHttpProtocol.cc.

## TS_Xeq3

#define TS_Xeq3 | ( |  | x,
|  |  | m )

Value:
(!strcmp(x,var)) GoNo = m(Config, extHIVec)

Definition at line 986 of file XrdHttpProtocol.cc.

## XRHTTP_TK_GRACETIME

#define XRHTTP_TK_GRACETIME 600

Definition at line 61 of file XrdHttpProtocol.cc.

Referenced by XrdHttpProtocol::Process().

## Function Documentation

## BIO_get_data()

void * BIO_get_data | ( | BIO * | bio | ) |

Definition at line 168 of file XrdHttpProtocol.cc.

{
return bio->ptr;
}

Referenced by BIO_XrdLink_destroy(), BIO_XrdLink_read(), and BIO_XrdLink_write().

Here is the caller graph for this function:

## BIO_get_flags()

int BIO_get_flags | ( | BIO * | bio | ) |

Definition at line 175 of file XrdHttpProtocol.cc.

{
return bio->flags;
}

## BIO_get_init()

int BIO_get_init | ( | BIO * | bio | ) |

Definition at line 182 of file XrdHttpProtocol.cc.

{
return bio->init;
}

## BIO_get_shutdown()

int BIO_get_shutdown | ( | BIO * | bio | ) |

Definition at line 191 of file XrdHttpProtocol.cc.

{
return bio->shutdown;
}

Referenced by BIO_XrdLink_ctrl(), and BIO_XrdLink_destroy().

Here is the caller graph for this function:

## BIO_set_data()

void BIO_set_data | ( | BIO * | bio,
|  | void * | ptr )

Definition at line 171 of file XrdHttpProtocol.cc.

{
bio->ptr = ptr;
}

Referenced by BIO_XrdLink_create().

Here is the caller graph for this function:

## BIO_set_flags()

void BIO_set_flags | ( | BIO * | bio,
|  | int | flags )

Definition at line 179 of file XrdHttpProtocol.cc.

{
bio->flags = flags;
}

Referenced by BIO_XrdLink_create(), BIO_XrdLink_destroy(), and Tobase64().

Here is the caller graph for this function:

## BIO_set_init()

void BIO_set_init | ( | BIO * | bio,
|  | int | init )

Definition at line 185 of file XrdHttpProtocol.cc.

{
bio->init = init;
}

Referenced by BIO_XrdLink_create(), and BIO_XrdLink_destroy().

Here is the caller graph for this function:

## BIO_set_shutdown()

void BIO_set_shutdown | ( | BIO * | bio,
|  | int | shut )

Definition at line 188 of file XrdHttpProtocol.cc.

{
bio->shutdown = shut;
}

Referenced by BIO_XrdLink_ctrl().

Here is the caller graph for this function:

## BIO_XrdLink_create()

int BIO_XrdLink_create | ( | BIO * | bio | ) |

static

Definition at line 415 of file XrdHttpProtocol.cc.

{
BIO_set_init(bio, 0);
//BIO_set_next(bio, 0);
BIO_set_data(bio, NULL);
BIO_set_flags(bio, 0);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
bio->num = 0;
#endif
return 1;
}
BIO_set_init
void BIO_set_init(BIO *bio, int init)
Definition XrdHttpProtocol.cc:185
BIO_set_data
void BIO_set_data(BIO *bio, void *ptr)
Definition XrdHttpProtocol.cc:171
BIO_set_flags
void BIO_set_flags(BIO *bio, int flags)
Definition XrdHttpProtocol.cc:179

References BIO_set_data(), BIO_set_flags(), and BIO_set_init().

Here is the call graph for this function:

## BIO_XrdLink_ctrl()

long BIO_XrdLink_ctrl | ( | BIO * | bio,
|  | int | cmd,
|  | long | num,
|  | void * | ptr )

static

Definition at line 448 of file XrdHttpProtocol.cc.

{
long ret = 1;
switch (cmd) {
case BIO_CTRL_GET_CLOSE:
ret = BIO_get_shutdown(bio);
break;
case BIO_CTRL_SET_CLOSE:
BIO_set_shutdown(bio, (int)num);
break;
case BIO_CTRL_DUP:
case BIO_CTRL_FLUSH:
ret = 1;
break;
default:
ret = 0;
break;
}
return ret;
}
BIO_get_shutdown
int BIO_get_shutdown(BIO *bio)
Definition XrdHttpProtocol.cc:191
BIO_set_shutdown
void BIO_set_shutdown(BIO *bio, int shut)
Definition XrdHttpProtocol.cc:188

References BIO_get_shutdown(), and BIO_set_shutdown().

Here is the call graph for this function:

## BIO_XrdLink_destroy()

int BIO_XrdLink_destroy | ( | BIO * | bio | ) |

static

Definition at line 434 of file XrdHttpProtocol.cc.

{
if (bio == NULL) return 0;
if (BIO_get_shutdown(bio)) {
if (BIO_get_data(bio)) {
static_cast<XrdLink*>(BIO_get_data(bio))->Close();
}
BIO_set_init(bio, 0);
BIO_set_flags(bio, 0);
}
return 1;
}
BIO_get_data
void * BIO_get_data(BIO *bio)
Definition XrdHttpProtocol.cc:168
XrdLink
Definition XrdLink.hh:52
XrdCl::Close
CloseImpl< false > Close(Ctx< File > file, uint16_t timeout=0)
Factory for creating CloseImpl objects.
Definition XrdClFileOperations.hh:482

References BIO_get_data(), BIO_get_shutdown(), BIO_set_flags(), and BIO_set_init().

Here is the call graph for this function:

## BIO_XrdLink_read()

int BIO_XrdLink_read | ( | BIO * | bio,
|  | char * | data,
|  | size_t | datal,
|  | size_t * | read )

static

Definition at line 374 of file XrdHttpProtocol.cc.

{
if (!data || !bio) {
*read = 0;
return 0;
}
errno = 0;
XrdLink *lp = static_cast<XrdLink *>(BIO_get_data(bio));
int ret = lp->Recv(data, datal);
BIO_clear_retry_flags(bio);
if (ret <= 0) {
*read = 0;
if ((errno == EINTR) || (errno == EINPROGRESS) || (errno == EAGAIN) || (errno == EWOULDBLOCK))
BIO_set_retry_read(bio);
return ret;
}
*read = ret;
}
read
#define read(a, b, c)
Definition XrdPosix.hh:82
XrdLink::Recv
int Recv(char *buff, int blen)
Definition XrdLink.cc:284

References BIO_get_data(), read, and XrdLink::Recv().

Here is the call graph for this function:

## BIO_XrdLink_write()

int BIO_XrdLink_write | ( | BIO * | bio,
|  | const char * | data,
|  | size_t | datal,
|  | size_t * | written )

Definition at line 331 of file XrdHttpProtocol.cc.

{
if (!data || !bio) {
*written = 0;
return 0;
}
XrdLink *lp=static_cast<XrdLink *>(BIO_get_data(bio));
errno = 0;
int ret = lp->Send(data, datal);
BIO_clear_retry_flags(bio);
if (ret <= 0) {
*written = 0;
if ((errno == EINTR) || (errno == EINPROGRESS) || (errno == EAGAIN) || (errno == EWOULDBLOCK))
BIO_set_retry_write(bio);
return ret;
}
*written = ret;
return 1;
}
XrdLink::Send
int Send(const char *buff, int blen)
Definition XrdLink.cc:331

References BIO_get_data(), and XrdLink::Send().

Here is the call graph for this function:

## XrdVERSIONINFODEF()

XrdVERSIONINFODEF | ( | compiledVer | ,
|  | XrdHttpProtocolTest | ,
|  | XrdVNUMBER | ,
|  | XrdVERSION | )

static

References XrdHttpSecXtractorArgs.

Referenced by XrdCksConfig::XrdCksConfig(), XrdCksLoader::XrdCksLoader(), XrdFrmConfig::XrdFrmConfig(), XrdOssSys::XrdOssSys(), XrdSsiSfsConfig::XrdSsiSfsConfig(), XrdOucLogging::configLog(), XrdCryptoFactory::GetCryptoFactory(), XrdSysPlugin::getPlugin(), XrdOucN2NLoader::Load(), main(), XrdAccDefaultAuthorizeObject(), XrdXrootdloadFileSystem(), and XrdXrootdloadRedirLib().

Here is the caller graph for this function:

## Variable Documentation

## XrdHttpSecEntityTident

const char* XrdHttpSecEntityTident = "http"

Definition at line 69 of file XrdHttpProtocol.cc.

## XrdHttpTrace

XrdSysTrace XrdHttpTrace("http") | ( | "http" |  | ) |

Referenced by XrdHttpProtocol::Configure().