96 int httpStatusCode{-1};
100 int initialStatusCode{-1};
105 std::string httpErrorCode;
114 std::string httpErrorBody;
118 std::string m_user_agent;
121 bool m_transfer_encoding_chunked;
122 long long m_current_chunk_offset;
123 long long m_current_chunk_size;
126 bool m_trailer_headers{
false};
131 bool m_status_trailer{
false};
133 int parseHost(
char *);
135 void parseScitag(
const std::string & val);
138 XrdHttpProtocol *prot;
140 void clientMarshallReadAheadList(
int nitems);
141 void clientUnMarshallReadAheadList(
int nitems);
148 int PostProcessChecksum(std::string &digest_header);
152 int PostProcessListing(
bool final_);
156 int ReturnGetHeaders();
163 int PostProcessHTTPReq(
bool final =
false);
166 void parseResource(
char *url);
169 void generateWebdavErrMsg();
172 void sanitizeResourcePfx();
181 int sendReadResponseSingleRange(
const XrdHttpIOList &received);
185 int sendReadResponsesMultiRanges(
const XrdHttpIOList &received);
189 int sendFooterError(
const std::string &);
192 void addAgeHeader(std::string & headers);
196 void addETagHeader(std::string & headers);
223 virtual void reset();
229 httpStatusCode = code;
230 if (initialStatusCode < 0 && code >= 200 ) {
231 initialStatusCode = code;
242 int parseBody(
char *body,
long long len);
258 void addCgi(
const std::string & key,
const std::string & value);
264 const std::string &
userAgent()
const {
return m_user_agent;}
368 std::chrono::steady_clock::time_point
startTime = std::chrono::steady_clock::time_point::min();
505void 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.