75 std::string httpStatusText;
78 std::string m_user_agent;
81 bool m_transfer_encoding_chunked;
82 long long m_current_chunk_offset;
83 long long m_current_chunk_size;
86 bool m_trailer_headers{
false};
91 bool m_status_trailer{
false};
93 int parseHost(
char *);
95 void parseScitag(
const std::string & val);
100 void clientMarshallReadAheadList(
int nitems);
101 void clientUnMarshallReadAheadList(
int nitems);
108 int PostProcessChecksum(std::string &digest_header);
112 int PostProcessListing(
bool final_);
116 int ReturnGetHeaders();
123 int PostProcessHTTPReq(
bool final =
false);
126 void parseResource(
char *url);
128 void mapXrdErrorToHttpStatus();
131 void sanitizeResourcePfx();
140 int sendReadResponseSingleRange(
const XrdHttpIOList &received);
144 int sendReadResponsesMultiRanges(
const XrdHttpIOList &received);
148 void sendFooterError(
const std::string &);
155 static void extractChecksumFromList(
const std::string & checksumList, std::vector<std::string> & extractedChecksum);
163 static void determineXRootDChecksumFromUserDigest(
const std::string & userDigest, std::vector<std::string> & xrootdChecksums);
182 virtual void reset();
191 int parseBody(
char *body,
long long len);
207 void addCgi(
const std::string & key,
const std::string & value);
210 const std::string &
userAgent()
const {
return m_user_agent;}
459 void trim(std::string &str);
void trim(std::string &str)
std::vector< XrdOucIOVec2 > XrdHttpIOList
int reqstate
State machine to talk to the bridge.
int ReqReadV(const XrdHttpIOList &cl)
Prepare the buffers for sending a readv request.
unsigned int rwOpPartialDone
ReqType
These are the HTTP/DAV requests that we support.
int parseBody(char *body, long long len)
Parse the body of a request, assuming that it's XML and that it's entirely in memory.
std::vector< readahead_list > ralist
std::string destination
The destination field specified in the req.
XrdOucString resource
The resource specified by the request, stripped of opaque data.
bool headerok
Tells if we have finished reading the header.
std::string m_digest_header
The computed digest for the HTTP response header.
std::string stringresp
If we want to give a string as a response, we compose it here.
XResponseType xrdresp
The last response data we got.
ReqType request
The request we got.
long long writtenbytes
In a long write, we track where we have arrived.
XrdOucEnv * opaque
The opaque data, after parsing.
const struct iovec * iovP
The latest data chunks got from the xrd layer. These are valid only inside the callbacks!
std::string m_req_digest
The requested digest type.
XrdOucString resourceplusopaque
The resource specified by the request, including all the opaque data.
virtual bool Data(XrdXrootd::Bridge::Context &info, const struct iovec *iovP, int iovN, int iovL, bool final)
std::string hdr2cgistr
Additional opaque info that may come from the hdr2cgi directive.
virtual bool Done(XrdXrootd::Bridge::Context &info)
the result context
std::string host
The host field specified in the req.
int parseFirstLine(char *line, int len)
Parse the first line of the header.
int parseLine(char *line, int len)
Parse the header.
std::string buildPartialHdrEnd(char *token)
Build the closing part for a multipart response.
XrdHttpChecksumHandler::XrdHttpChecksumRawPtr m_req_cksum
The checksum that was ran for this request.
bool m_appended_hdr2cgistr
void appendOpaque(XrdOucString &s, XrdSecEntity *secent, char *hash, time_t tnow)
XrdHttpReq(XrdHttpProtocol *protinstance, const XrdHttpReadRangeHandler::Configuration &rcfg)
bool m_appended_asize
Track whether we already appended the oss.asize argument for PUTs.
XrdOucString m_resource_with_digest
virtual bool Redir(XrdXrootd::Bridge::Context &info, int port, const char *hname)
virtual int File(XrdXrootd::Bridge::Context &info, int dlen)
std::map< std::string, std::string > allheaders
unsigned int rwOpDone
To coordinate multipart responses across multiple calls.
void addCgi(const std::string &key, const std::string &value)
ClientRequest xrdreq
The last issued xrd request, often pending.
const std::string & userAgent() const
std::string buildPartialHdr(long long bytestart, long long byteend, long long filesize, char *token)
Build a partial header for a multipart response.
XrdHttpReadRangeHandler readRangeHandler
Tracking the next ranges of data to read during GET.
virtual bool Error(XrdXrootd::Bridge::Context &info, int ecode, const char *etext)