103 std::string httpErrorCode;
112 std::string httpErrorBody;
116 std::string m_user_agent;
119 bool m_transfer_encoding_chunked;
120 long long m_current_chunk_offset;
121 long long m_current_chunk_size;
124 bool m_trailer_headers{
false};
129 bool m_status_trailer{
false};
131 int parseHost(
char *);
133 void parseScitag(
const std::string & val);
138 void clientMarshallReadAheadList(
int nitems);
139 void clientUnMarshallReadAheadList(
int nitems);
146 int PostProcessChecksum(std::string &digest_header);
150 int PostProcessListing(
bool final_);
154 int ReturnGetHeaders();
161 int PostProcessHTTPReq(
bool final =
false);
164 void parseResource(
char *url);
166 void mapXrdErrorToHttpStatus();
171 std::string
etext,
const char *desc,
172 const char *header_to_add,
bool keepalive);
175 void sanitizeResourcePfx();
184 int sendReadResponseSingleRange(
const XrdHttpIOList &received);
188 int sendReadResponsesMultiRanges(
const XrdHttpIOList &received);
192 int sendFooterError(
const std::string &);
195 void addAgeHeader(std::string & headers);
201 static void extractChecksumFromList(
const std::string & checksumList, std::vector<std::string> & extractedChecksum);
209 static void determineXRootDChecksumFromUserDigest(
const std::string & userDigest, std::vector<std::string> & xrootdChecksums);
228 virtual void reset();
237 int parseBody(
char *body,
long long len);
253 void addCgi(
const std::string & key,
const std::string & value);
259 const std::string &
userAgent()
const {
return m_user_agent;}
490 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
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.
ReqType
These are the HTTP/DAV requests that we support.
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.
void setTransferStatusHeader(std::string &header)
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)