]> git.ipfire.org Git - thirdparty/squid.git/blob - src/HttpHdrContRange.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / HttpHdrContRange.h
1 /*
2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9 #ifndef SQUID_HTTPHDRCONTRANGE_H
10 #define SQUID_HTTPHDRCONTRANGE_H
11
12 #include "HttpHeaderRange.h"
13
14 class HttpHeader;
15
16 /** HTTP Content-Range: header field */
17 class HttpHdrContRange
18 {
19 MEMPROXY_CLASS(HttpHdrContRange);
20
21 public:
22 HttpHdrContRange() : elength(0) {}
23
24 HttpHdrRangeSpec spec;
25 int64_t elength; /**< entity length, not content length */
26 };
27
28 /** \todo CLEANUP: Move httpHdrContRange* functions into the class methods */
29
30 HttpHdrContRange *httpHdrContRangeCreate(void);
31 HttpHdrContRange *httpHdrContRangeParseCreate(const char *crange_spec);
32 /** returns true if range is valid; inits HttpHdrContRange */
33 int httpHdrContRangeParseInit(HttpHdrContRange * crange, const char *crange_spec);
34 HttpHdrContRange *httpHdrContRangeDup(const HttpHdrContRange * crange);
35 void httpHdrContRangePackInto(const HttpHdrContRange * crange, Packable * p);
36 /** inits with given spec */
37 void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, int64_t);
38 void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, int64_t);
39
40 #endif /* SQUID_HTTPHDRCONTRANGE_H */
41