97 int httpStatusCode{-1};
101 int initialStatusCode{-1};
106 std::string httpErrorCode;
115 std::string httpErrorBody;
119 std::string m_user_agent;
122 bool m_transfer_encoding_chunked{
false};
123 long long m_current_chunk_offset;
124 long long m_current_chunk_size;
127 bool m_trailer_headers{
false};
132 bool m_status_trailer{
false};
134 int parseHost(
char *);
136 void parseScitag(
const std::string & val);
139 XrdHttpProtocol *prot;
141 void clientMarshallReadAheadList(
int nitems);
142 void clientUnMarshallReadAheadList(
int nitems);
149 int PostProcessChecksum(std::string &digest_header);
153 int PostProcessListing(
bool final_);
157 int ReturnGetHeaders();
164 int PostProcessHTTPReq(
bool final =
false);
167 void parseResource(
char *url);
170 void generateWebdavErrMsg();
173 void sanitizeResourcePfx();
182 int sendReadResponseSingleRange(
const XrdHttpIOList &received);
186 int sendReadResponsesMultiRanges(
const XrdHttpIOList &received);
190 int sendFooterError(
const std::string &);
193 void addAgeHeader(std::string & headers);
197 void addETagHeader(std::string & headers);
224 virtual void reset();
230 httpStatusCode = code;
231 if (initialStatusCode < 0 && code >= 200 ) {
232 initialStatusCode = code;
243 int parseBody(
char *body,
long long len);
259 void addCgi(
const std::string & key,
const std::string & value);
265 const std::string &
userAgent()
const {
return m_user_agent;}
370 std::chrono::steady_clock::time_point
startTime = std::chrono::steady_clock::time_point::min();
507void trim(std::string &str);
void trim(std::string &str)
std::vector< XrdOucIOVec2 > XrdHttpIOList
XrdHttpChecksumHandlerImpl::XrdHttpChecksumRawPtr XrdHttpChecksumRawPtr
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::map< std::string, uint8_t > m_want_repr_digest
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.
const std::string & userAgent() const
XResponseType xrdresp
The last response data we got.
std::map< std::string, std::string > m_repr_digest
Repr-Digest map where the key is the digest name and the value is the base64 encoded digest value.
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!
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.
void setHttpStatusCode(int code)
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.
std::string m_want_digest
The requested digest type.
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
std::chrono::steady_clock::time_point startTime
virtual bool Redir(XrdXrootd::Bridge::Context &info, int port, const char *hname)
std::map< std::string, std::string > allheaders
int getInitialStatusCode()
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.
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.