23 #ifndef XROOTD_XRDHTTPREADRANGEHANDLER_HH
24 #define XROOTD_XRDHTTPREADRANGEHANDLER_HH
58 const size_t vectorReadMaxChunks,
59 const size_t rRequestMaxBytes) :
79 explicit operator bool()
const {
return errSet; }
81 void set(
int rc,
const std::string &m)
210 const UserRange**
const urp,
243 int parseOneRange(
char*
const str);
244 int rangeFig(
const char*
const s,
bool &set, off_t &start);
245 void resolveRanges();
253 bool rangesResolved_;
261 size_t resolvedRangeIdx_;
262 off_t resolvedRangeOff_;
266 size_t splitRangeIdx_;
267 off_t splitRangeOff_;
271 size_t currSplitRangeIdx_;
272 int currSplitRangeOff_;
276 size_t vectorReadMaxChunkSize_;
277 size_t vectorReadMaxChunks_;
278 size_t rRequestMaxBytes_;
Utility functions for XrdHTTP.
std::vector< XrdOucIOVec2 > XrdHttpIOList
static constexpr size_t READV_MAXCHUNKSIZE
void reset()
resets this handler
const XrdHttpIOList & NextReadList()
return XrdHttpIOList for sending to read or readv
void ParseContentRange(const char *const line)
parse the line after a "Range: " http request header
int SetFilesize(const off_t sz)
sets the filesize, used during resolving and issuing range requests
XrdHttpReadRangeHandler(const Configuration &conf)
static int Configure(XrdSysError &Eroute, const char *const parms, Configuration &cfg)
void NotifyError()
Force handler to enter error state.
bool isFullFile()
indicates when there were no valid Range head ranges supplied
std::vector< UserRange > UserRangeList
int NotifyReadResult(const ssize_t ret, const UserRange **const urp, bool &start, bool &allend)
Advance internal counters concerning received bytes.
const Error & getError() const
return the Error object
bool isSingleRange()
indicates a single range (implied whole file, or single range) or empty file
static constexpr size_t RREQ_MAXSIZE
static constexpr size_t READV_MAXCHUNKS
const UserRangeList & ListResolvedRanges()
return resolved (i.e. obsolute start and end) byte ranges desired
Configuration(const size_t vectorReadMaxChunkSize, const size_t vectorReadMaxChunks, const size_t rRequestMaxBytes)
void set(int rc, const std::string &m)
UserRange(off_t st, off_t en)