]>
Commit | Line | Data |
---|---|---|
7ede6971 | 1 | /* |
bbc27441 | 2 | * Copyright (C) 1996-2014 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 | ||
7ede6971 | 12 | #include "HttpHdrScTarget.h" |
13 | ||
582c2af2 FC |
14 | class StatHist; |
15 | ||
7ede6971 | 16 | /* http surogate control header field */ |
17 | ||
18 | class HttpHdrSc | |
19 | { | |
20 | ||
21 | public: | |
45a58345 FC |
22 | HttpHdrSc(const HttpHdrSc &); |
23 | HttpHdrSc() {} | |
24 | ~HttpHdrSc(); | |
25 | ||
26 | bool parse(const String *str); | |
27 | void packInto(Packer * p) const; | |
28 | void updateStats(StatHist *) const; | |
29 | HttpHdrScTarget * getMergedTarget (const char *ourtarget); //todo: make const? | |
30 | void setMaxAge(char const *target, int max_age); | |
31 | void addTarget(HttpHdrScTarget *t) { | |
32 | dlinkAdd(t, &t->node, &targets); | |
33 | } | |
34 | void addTargetAtTail(HttpHdrScTarget *t) { | |
35 | dlinkAddTail (t, &t->node, &targets); | |
36 | } | |
37 | ||
7ede6971 | 38 | MEMPROXY_CLASS(HttpHdrSc); |
39 | dlink_list targets; | |
45a58345 FC |
40 | private: |
41 | HttpHdrScTarget * findTarget (const char *target); | |
42 | ||
7ede6971 | 43 | }; |
44 | ||
45 | MEMPROXY_CLASS_INLINE(HttpHdrSc); | |
46 | ||
47 | /* Http Surrogate Control Header Field */ | |
8a648e8d FC |
48 | void httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int count); |
49 | void httpHdrScInitModule (void); | |
50 | void httpHdrScCleanModule (void); | |
51 | HttpHdrSc *httpHdrScParseCreate(String const &); | |
52 | void httpHdrScSetMaxAge(HttpHdrSc *, char const *, int); | |
7ede6971 | 53 | |
54 | #endif /* SQUID_HTTPHDRSURROGATECONTROL_H */ |