Loading...
Searching...
No Matches
XrdHttpModule.cc
Go to the documentation of this file.
#include "XrdVersion.hh"
#include "XrdHttpProtocol.hh"
/******************************************************************************/
/* P r o t o c o l L o a d e r */
/* X r d g e t P r o t o c o l */
/******************************************************************************/
// This protocol can live in a module. The interface below is used by
// the protocol driver to obtain a copy of the protocol object that can be used
// to decide whether or not a link is talking a particular protocol.
//
XrdVERSIONINFO(XrdgetProtocol, xrdhttp);
extern "C" {
XrdProtocol *XrdgetProtocol(const char *pname, char *parms,
XrdProtocol_Config *pi) {
XrdProtocol *pp = 0;
const char *txt = "completed.";
// Put up the banner
//
pi->eDest->Say("Copr. 2012 CERN IT, an HTTP implementation for the XRootD framework.");
pi->eDest->Say("++++++ HTTP protocol initialization started.");
// Return the protocol object to be used if static init succeeds
//
if (XrdHttpProtocol::Configure(parms, pi))
pp = (XrdProtocol *)new XrdHttpProtocol(false);
else txt = "failed.";
pi->eDest->Say("------ HTTP protocol initialization ", txt);
return pp;
}
}
/******************************************************************************/
/* */
/* P r o t o c o l P o r t D e t e r m i n a t i o n */
/* X r d g e t P r o t o c o l P o r t */
/******************************************************************************/
// This function is called early on to determine the port we need to use. The
// default is ostensibly 1094 but can be overridden; which we allow.
//
XrdVERSIONINFO(XrdgetProtocolPort, xrdhttp);
extern "C" {
int XrdgetProtocolPort(const char *pname, char *parms, XrdProtocol_Config *pi) {
// Figure out what port number we should return. In practice only one port
// number is allowed. However, we could potentially have a clustered port
// and several unclustered ports. So, we let this practicality slide.
//
if (pi->Port < 0) return 1094;
return pi->Port;
}
}
XrdgetProtocol
XrdProtocol * XrdgetProtocol(const char *pname, char *parms, XrdProtocol_Config *pi)
Definition XrdHttpModule.cc:19
XrdVERSIONINFO
XrdVERSIONINFO(XrdgetProtocol, xrdhttp)
XrdgetProtocolPort
int XrdgetProtocolPort(const char *pname, char *parms, XrdProtocol_Config *pi)
Definition XrdHttpModule.cc:53
XrdHttpProtocol.hh
A pragmatic implementation of the HTTP/DAV protocol for the Xrd framework.
XrdgetProtocol
XrdProtocol * XrdgetProtocol(const char *pname, char *parms, XrdProtocol_Config *pi)
Definition XrdCmsProtocol.cc:108
XrdgetProtocolPort
int XrdgetProtocolPort(const char *pname, char *parms, XrdProtocol_Config *pi)
Definition XrdCmsProtocol.cc:149
XrdHttpProtocol
Definition XrdHttpProtocol.hh:81
XrdHttpProtocol::Configure
static int Configure(char *parms, XrdProtocol_Config *pi)
Read and apply the configuration.
Definition XrdHttpProtocol.cc:1752
XrdProtocol_Config
Definition XrdProtocol.hh:56
XrdProtocol_Config::Port
int Port
Definition XrdProtocol.hh:73
XrdProtocol_Config::eDest
XrdSysError * eDest
Definition XrdProtocol.hh:61
XrdProtocol
Definition XrdProtocol.hh:125
XrdSysError::Say
void Say(const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)
Definition XrdSysError.cc:141