]> git.ipfire.org Git - thirdparty/squid.git/blame - src/HttpHdrContRange.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / HttpHdrContRange.h
CommitLineData
528b2c61 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
528b2c61 3 *
bbc27441
AJ
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
528b2c61 7 */
bbc27441 8
528b2c61 9#ifndef SQUID_HTTPHDRCONTRANGE_H
10#define SQUID_HTTPHDRCONTRANGE_H
11
e1f7507e
AJ
12#include "HttpHeaderRange.h"
13
3c670b50
AJ
14class HttpHeader;
15
e1f7507e 16/** HTTP Content-Range: header field */
62e76326 17class HttpHdrContRange
18{
3c670b50 19 MEMPROXY_CLASS(HttpHdrContRange);
62e76326 20
528b2c61 21public:
3c670b50
AJ
22 HttpHdrContRange() : elength(0) {}
23
528b2c61 24 HttpHdrRangeSpec spec;
f53969cc 25 int64_t elength; /**< entity length, not content length */
528b2c61 26};
27
e1f7507e
AJ
28/** \todo CLEANUP: Move httpHdrContRange* functions into the class methods */
29
43ca19e0
FC
30HttpHdrContRange *httpHdrContRangeCreate(void);
31HttpHdrContRange *httpHdrContRangeParseCreate(const char *crange_spec);
e1f7507e 32/** returns true if range is valid; inits HttpHdrContRange */
43ca19e0 33int httpHdrContRangeParseInit(HttpHdrContRange * crange, const char *crange_spec);
43ca19e0 34HttpHdrContRange *httpHdrContRangeDup(const HttpHdrContRange * crange);
17802cf1 35void httpHdrContRangePackInto(const HttpHdrContRange * crange, Packable * p);
e1f7507e 36/** inits with given spec */
43ca19e0
FC
37void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, int64_t);
38void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, int64_t);
25b6a907 39
528b2c61 40#endif /* SQUID_HTTPHDRCONTRANGE_H */
f53969cc 41