]>
Commit | Line | Data |
---|---|---|
7ede6971 | 1 | /* |
bf95c10a | 2 | * Copyright (C) 1996-2022 The Squid Software Foundation and contributors |
7ede6971 | 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. | |
7ede6971 | 7 | */ |
8 | ||
9 | #ifndef SQUID_HTTPHDRSURROGATECONTROL_H | |
10 | #define SQUID_HTTPHDRSURROGATECONTROL_H | |
11 | ||
24673a9e AJ |
12 | #include "http/forward.h" |
13 | #include "HttpHdrScTarget.h" | |
8b082ed9 | 14 | #include "mem/PoolingAllocator.h" |
b56ab9e7 | 15 | #include "SquidString.h" |
7ede6971 | 16 | |
24673a9e AJ |
17 | #include <list> |
18 | ||
b56ab9e7 | 19 | class Packable; |
1da82544 | 20 | class StatHist; |
b56ab9e7 FC |
21 | class StoreEntry; |
22 | ||
7ede6971 | 23 | /* http surogate control header field */ |
7ede6971 | 24 | class HttpHdrSc |
25 | { | |
741c2986 | 26 | MEMPROXY_CLASS(HttpHdrSc); |
7ede6971 | 27 | |
28 | public: | |
45a58345 | 29 | bool parse(const String *str); |
17802cf1 | 30 | void packInto(Packable * p) const; |
45a58345 | 31 | void updateStats(StatHist *) const; |
9837567d | 32 | HttpHdrScTarget * getMergedTarget(const char *ourtarget); // TODO: make const? |
45a58345 | 33 | void setMaxAge(char const *target, int max_age); |
45a58345 | 34 | |
45a58345 FC |
35 | private: |
36 | HttpHdrScTarget * findTarget (const char *target); | |
37 | ||
24673a9e | 38 | std::list<HttpHdrScTarget, PoolingAllocator<HttpHdrScTarget>> targets; |
7ede6971 | 39 | }; |
40 | ||
7ede6971 | 41 | /* Http Surrogate Control Header Field */ |
8a648e8d FC |
42 | void httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int count); |
43 | void httpHdrScInitModule (void); | |
8a648e8d FC |
44 | HttpHdrSc *httpHdrScParseCreate(String const &); |
45 | void httpHdrScSetMaxAge(HttpHdrSc *, char const *, int); | |
7ede6971 | 46 | |
8b082ed9 | 47 | http_hdr_sc_type &operator++(http_hdr_sc_type &); |
7ede6971 | 48 | #endif /* SQUID_HTTPHDRSURROGATECONTROL_H */ |
f53969cc | 49 |