xrootd
|
#include <XrdHttpProtocol.hh>
Classes | |
struct | extHInfo |
struct | StaticPreloadInfo |
struct | XrdHttpExtHandlerInfo |
Public Member Functions | |
void | DoIt () |
Override from the base class. | |
XrdProtocol * | Match (XrdLink *lp) |
Tells if the oustanding bytes on the socket match this protocol implementation. | |
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. | |
int | doStat (char *fname) |
Perform a Stat request. | |
int | doChksum (const XrdOucString &fname) |
Perform a checksum request. | |
XrdHttpProtocol (const XrdHttpProtocol &)=default | |
Ctor, dtors and copy ctor. | |
XrdHttpProtocol | operator= (const XrdHttpProtocol &rhs) |
XrdHttpProtocol (bool imhttps) | |
~XrdHttpProtocol () | |
bool | isHTTPS () |
called via https | |
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. | |
Public Attributes | |
XrdObject< XrdHttpProtocol > | ProtLink |
XrdSecEntity | SecEntity |
Authentication area. | |
Public Attributes inherited from XrdJob | |
XrdJob * | NextJob |
const char * | Comment |
Static Public Attributes | |
static XrdObjectQ< XrdHttpProtocol > | ProtStack |
static XrdHttpChecksumHandler | cksumHandler |
static XrdHttpReadRangeHandler::Configuration | ReadRangeConfig |
configuration for the read range handler | |
Protected Attributes | |
XrdLink * | Link |
The link we are bound to. | |
char * | Addr_str |
XrdXrootd::Bridge * | Bridge |
The Bridge that we use to exercise the xrootd internals. | |
XrdHttpReq | CurrentReq |
Static Protected Attributes | |
static XrdScheduler * | Sched |
static XrdBuffManager * | BPool |
static XrdSysError | eDest |
static XrdSecService * | CIA |
static XrdOucGMap * | servGMap |
The instance of the DN mapper. Created only when a valid path is given. | |
static int | hailWait |
Timeout for reading the handshake. | |
static int | readWait |
Timeout for reading data. | |
static int | Port |
Our port. | |
static char * | Port_str |
Our port, as a string. | |
static char * | sslcert |
OpenSSL stuff. | |
static char * | sslkey |
static char * | sslcadir |
static char * | sslcafile |
static char * | sslcipherfilter |
static int | crlRefIntervalSec |
CRL thread refresh interval. | |
static char * | gridmap |
Gridmap file location. The same used by XrdSecGsi. | |
static bool | isRequiredGridmap |
static bool | compatNameGeneration |
static char * | secretkey |
The key used to calculate the url hashes. | |
static int | sslverifydepth |
Depth of verification of a certificate chain. | |
static bool | isdesthttps |
True if the redirections must be towards https targets. | |
static char * | listredir |
Url to redirect to in the case a listing is requested. | |
static bool | listdeny |
If true, any form of listing is denied. | |
static bool | selfhttps2http |
If client is HTTPS, self-redirect with HTTP+token. | |
static bool | embeddedstatic |
If true, use the embedded css and icons. | |
static char * | staticredir |
static XrdOucHash< StaticPreloadInfo > * | staticpreload |
static kXR_int32 | myRole |
Our role. | |
static std::map< std::string, std::string > | hdr2cgimap |
Rules that turn HTTP headers to cgi tokens in the URL, for internal comsumption. | |
static int | m_bio_type |
Type identifier for our custom BIO objects. | |
static BIO_METHOD * | m_bio_method |
C-style vptr table for our custom BIO objects. | |
static char * | xrd_cslist |
The list of checksums that were configured via the xrd.cksum parameter on the server config file. | |
static XrdNetPMark * | pmarkHandle |
Packet marking handler pointer (assigned from the environment during the Config() call) | |
Private Member Functions | |
int | StartSimpleResp (int code, const char *desc, const char *header_to_add, long long bodylen, bool keepalive) |
Start a response back to the client. | |
int | SendData (const char *body, int bodylen) |
Send some generic data to the client. | |
void | Cleanup () |
Deallocate resources, in order to reutilize an object of this class. | |
void | Reset () |
Reset values, counters, in order to reutilize an object of this class. | |
int | HandleAuthentication (XrdLink *lp) |
int | GetVOMSData (XrdLink *lp) |
int | HandleGridMap (XrdLink *lp, const char *eechash) |
int | getDataOneShot (int blen, bool wait=false) |
int | BuffAvailable () |
How many bytes still fit into the buffer in a contiguous way. | |
int | BuffUsed () |
How many bytes in the buffer. | |
int | BuffFree () |
How many bytes free in the buffer. | |
void | BuffConsume (int blen) |
Consume some bytes from the buffer. | |
int | BuffgetData (int blen, char **data, bool wait) |
Get a pointer, valid for up to blen bytes from the buffer. Returns the validity. | |
int | BuffgetLine (XrdOucString &dest) |
Copy a full line of text from the buffer into dest. Zero if no line can be found in the buffer. | |
int | SendSimpleResp (int code, const char *desc, const char *header_to_add, const char *body, long long bodylen, bool keepalive) |
Sends a basic response. If the length is < 0 then it is calculated internally. | |
int | StartChunkedResp (int code, const char *desc, const char *header_to_add, long long bodylen, bool keepalive) |
Starts a chunked response; body of request is sent over multiple parts using the SendChunkResp. | |
int | ChunkResp (const char *body, long long bodylen) |
Send a (potentially partial) body in a chunked response; invoking with NULL body. | |
int | ChunkRespHeader (long long bodylen) |
Send the beginning of a chunked response but not the body; useful when the size. | |
int | ChunkRespFooter () |
Send the footer of the chunk response. | |
char * | GetClientIPStr () |
Gets a string that represents the IP address of the client. Must be freed. | |
Static Private Member Functions | |
static bool | InitTLS () |
Initialization of the ssl security things. | |
static bool | InitSecurity () |
Initialization fo security addon. | |
static BIO * | CreateBIO (XrdLink *lp) |
Create a new BIO object from an XrdLink. Returns NULL on failure. | |
static int | Config (const char *fn, XrdOucEnv *myEnv) |
Functions related to the configuration. | |
static const char * | Configed () |
static int | xtrace (XrdOucStream &Config) |
static int | xsslcert (XrdOucStream &Config) |
static int | xsslkey (XrdOucStream &Config) |
static int | xsecxtractor (XrdOucStream &Config) |
static int | xexthandler (XrdOucStream &Config, std::vector< extHInfo > &hiVec) |
static int | xsslcadir (XrdOucStream &Config) |
static int | xsslcipherfilter (XrdOucStream &Config) |
static int | xdesthttps (XrdOucStream &Config) |
static int | xlistdeny (XrdOucStream &Config) |
static int | xlistredir (XrdOucStream &Config) |
static int | xselfhttps2http (XrdOucStream &Config) |
static int | xembeddedstatic (XrdOucStream &Config) |
static int | xstaticredir (XrdOucStream &Config) |
static int | xstaticpreload (XrdOucStream &Config) |
static int | xgmap (XrdOucStream &Config) |
static int | xsslcafile (XrdOucStream &Config) |
static int | xsslverifydepth (XrdOucStream &Config) |
static int | xsecretkey (XrdOucStream &Config) |
static int | xheader2cgi (XrdOucStream &Config) |
static int | xhttpsmode (XrdOucStream &Config) |
static int | xtlsreuse (XrdOucStream &Config) |
static int | LoadSecXtractor (XrdSysError *eDest, const char *libName, const char *libParms) |
static int | LoadExtHandler (std::vector< extHInfo > &hiVec, const char *cFN, XrdOucEnv &myEnv) |
static int | LoadExtHandler (XrdSysError *eDest, const char *libName, const char *configFN, const char *libParms, XrdOucEnv *myEnv, const char *instName) |
static XrdHttpExtHandler * | FindMatchingExtHandler (const XrdHttpReq &) |
static bool | ExtHandlerLoaded (const char *handlername) |
Private Attributes | |
int(XrdHttpProtocol::* | Resume )() |
The resume function. | |
XrdBuffer * | myBuff |
Circular Buffer used to read the request. | |
char * | myBuffStart |
The circular pointers. | |
char * | myBuffEnd |
XrdOucString | tmpline |
A nice var to hold the current header line. | |
bool | DoingLogin |
Tells that we are just logging in. | |
long | ResumeBytes |
Tells that we are just waiting to have N bytes in the buffer. | |
SSL * | ssl |
Private SSL context. | |
BIO * | sbio |
Private SSL bio. | |
bool | ishttps |
Tells if the client is https. | |
bool | ssldone |
Static Private Attributes | |
static bool | isRequiredXtractor |
static XrdHttpSecXtractor * | secxtractor |
static bool | usingEC |
static struct XrdHttpProtocol::XrdHttpExtHandlerInfo | exthandler [MAX_XRDHTTPEXTHANDLERS] |
static int | exthandlercnt |
static BIO * | sslbio_err |
bio to print SSL errors | |
static XrdCryptoFactory * | myCryptoFactory |
Friends | |
class | XrdHttpReq |
class | XrdHttpExtReq |
|
default |
Ctor, dtors and copy ctor.
XrdHttpProtocol::XrdHttpProtocol | ( | bool | imhttps | ) |
|
inline |
References Cleanup().
|
private |
How many bytes still fit into the buffer in a contiguous way.
|
private |
Consume some bytes from the buffer.
|
private |
How many bytes free in the buffer.
|
private |
Get a pointer, valid for up to blen bytes from the buffer. Returns the validity.
|
private |
Copy a full line of text from the buffer into dest. Zero if no line can be found in the buffer.
|
private |
How many bytes in the buffer.
|
private |
Send a (potentially partial) body in a chunked response; invoking with NULL body.
|
private |
Send the footer of the chunk response.
|
private |
Send the beginning of a chunked response but not the body; useful when the size.
|
private |
Deallocate resources, in order to reutilize an object of this class.
Referenced by ~XrdHttpProtocol().
|
staticprivate |
Functions related to the configuration.
|
staticprivate |
|
static |
Read and apply the configuration.
|
staticprivate |
Create a new BIO object from an XrdLink. Returns NULL on failure.
int XrdHttpProtocol::doChksum | ( | const XrdOucString & | fname | ) |
Perform a checksum request.
|
inlinevirtual |
int XrdHttpProtocol::doStat | ( | char * | fname | ) |
Perform a Stat request.
|
staticprivate |
|
staticprivate |
|
private |
Gets a string that represents the IP address of the client. Must be freed.
|
private |
Get up to blen bytes from the connection. Put them into mybuff. This primitive, for the way it is used, is not supposed to block
|
private |
After the SSL handshake, retrieve the VOMS info and the various stuff that is needed for autorization
|
private |
Handle authentication of the client
|
private |
|
staticprivate |
Initialization fo security addon.
|
staticprivate |
Initialization of the ssl security things.
|
inline |
called via https
References ishttps.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
virtual |
Tells if the oustanding bytes on the socket match this protocol implementation.
Implements XrdProtocol.
XrdHttpProtocol XrdHttpProtocol::operator= | ( | const XrdHttpProtocol & | rhs | ) |
|
virtual |
Process data incoming from the socket.
Implements XrdProtocol.
|
virtual |
Recycle this instance.
Implements XrdProtocol.
|
private |
Reset values, counters, in order to reutilize an object of this class.
|
private |
Send some generic data to the client.
|
private |
Sends a basic response. If the length is < 0 then it is calculated internally.
|
private |
Starts a chunked response; body of request is sent over multiple parts using the SendChunkResp.
|
private |
Start a response back to the client.
|
virtual |
Get activity stats.
Implements XrdProtocol.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
friend |
|
friend |
|
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.
|
staticprotected |
|
protected |
The Bridge that we use to exercise the xrootd internals.
|
staticprotected |
|
static |
|
staticprotected |
|
staticprotected |
CRL thread refresh interval.
|
protected |
Area for coordinating request and responses to/from the bridge This also can process HTTP/DAV stuff
|
private |
Tells that we are just logging in.
|
staticprotected |
|
staticprotected |
If true, use the embedded css and icons.
|
staticprivate |
|
staticprivate |
|
staticprotected |
Gridmap file location. The same used by XrdSecGsi.
|
staticprotected |
Timeout for reading the handshake.
|
staticprotected |
Rules that turn HTTP headers to cgi tokens in the URL, for internal comsumption.
|
staticprotected |
True if the redirections must be towards https targets.
|
private |
Tells if the client is https.
Referenced by isHTTPS().
|
staticprotected |
|
staticprivate |
|
protected |
The link we are bound to.
|
staticprotected |
If true, any form of listing is denied.
|
staticprotected |
Url to redirect to in the case a listing is requested.
|
staticprotected |
C-style vptr table for our custom BIO objects.
|
staticprotected |
Type identifier for our custom BIO objects.
|
private |
Circular Buffer used to read the request.
|
private |
|
private |
The circular pointers.
|
staticprivate |
|
staticprotected |
Our role.
|
staticprotected |
Packet marking handler pointer (assigned from the environment during the Config() call)
|
staticprotected |
Our port.
|
staticprotected |
Our port, as a string.
XrdObject<XrdHttpProtocol> XrdHttpProtocol::ProtLink |
|
static |
|
static |
configuration for the read range handler
|
staticprotected |
Timeout for reading data.
|
private |
The resume function.
Referenced by DoIt().
|
private |
Tells that we are just waiting to have N bytes in the buffer.
|
private |
Private SSL bio.
|
staticprotected |
XrdSecEntity XrdHttpProtocol::SecEntity |
Authentication area.
|
staticprotected |
The key used to calculate the url hashes.
|
staticprivate |
|
staticprotected |
If client is HTTPS, self-redirect with HTTP+token.
|
staticprotected |
The instance of the DN mapper. Created only when a valid path is given.
|
private |
Private SSL context.
|
staticprivate |
bio to print SSL errors
|
staticprotected |
|
staticprotected |
|
staticprotected |
OpenSSL stuff.
|
staticprotected |
|
private |
Flag to tell if the https handshake has finished, in the case of an https connection being established
|
staticprotected |
|
staticprotected |
Depth of verification of a certificate chain.
|
staticprotected |
|
staticprotected |
|
private |
A nice var to hold the current header line.
|
staticprivate |
|
staticprotected |
The list of checksums that were configured via the xrd.cksum parameter on the server config file.