]>
Commit | Line | Data |
---|---|---|
528b2c61 | 1 | /* |
77b1029d | 2 | * Copyright (C) 1996-2020 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 |
14 | class HttpHeader; |
15 | ||
e1f7507e | 16 | /** HTTP Content-Range: header field */ |
62e76326 | 17 | class HttpHdrContRange |
18 | { | |
3c670b50 | 19 | MEMPROXY_CLASS(HttpHdrContRange); |
62e76326 | 20 | |
528b2c61 | 21 | public: |
3c670b50 AJ |
22 | HttpHdrContRange() : elength(0) {} |
23 | ||
528b2c61 | 24 | HttpHdrRangeSpec spec; |
f53969cc | 25 | int64_t elength; /**< entity length, not content length */ |
528b2c61 | 26 | }; |
27 | ||
9837567d | 28 | // TODO: move httpHdrContRange* functions into the class methods |
e1f7507e | 29 | |
43ca19e0 FC |
30 | HttpHdrContRange *httpHdrContRangeCreate(void); |
31 | HttpHdrContRange *httpHdrContRangeParseCreate(const char *crange_spec); | |
e1f7507e | 32 | /** returns true if range is valid; inits HttpHdrContRange */ |
43ca19e0 | 33 | int httpHdrContRangeParseInit(HttpHdrContRange * crange, const char *crange_spec); |
43ca19e0 | 34 | HttpHdrContRange *httpHdrContRangeDup(const HttpHdrContRange * crange); |
17802cf1 | 35 | void httpHdrContRangePackInto(const HttpHdrContRange * crange, Packable * p); |
e1f7507e | 36 | /** inits with given spec */ |
43ca19e0 FC |
37 | void httpHdrContRangeSet(HttpHdrContRange *, HttpHdrRangeSpec, int64_t); |
38 | void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, int64_t); | |
25b6a907 | 39 | |
528b2c61 | 40 | #endif /* SQUID_HTTPHDRCONTRANGE_H */ |
f53969cc | 41 |