]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/icap/History.h
SourceFormat: enforcement
[thirdparty/squid.git] / src / adaptation / icap / History.h
1 #ifndef SQUID_ICAPHISTORY_H
2 #define SQUID_ICAPHISTORY_H
3
4 #include "RefCount.h"
5 #include "HttpHeader.h"
6 #include "enums.h"
7
8 namespace Adaptation
9 {
10 namespace Icap
11 {
12
13 /// collects information about ICAP processing related to an HTTP transaction
14 class History: public RefCountable
15 {
16 public:
17 typedef RefCount<History> Pointer;
18
19 History();
20 History(const History& ih);
21
22 ~History();
23
24 History& operator=(const History& ih);
25
26 ///store the last reply header from ICAP server
27 void setIcapLastHeader(const HttpHeader * lih);
28 ///merge new header and stored one
29 void mergeIcapHeaders(const HttpHeader * lih);
30
31 /// record the start of an ICAP processing interval
32 void start(const char *context);
33 /// note the end of an ICAP processing interval
34 void stop(const char *context);
35
36 /// returns the total time of all ICAP processing intervals
37 int processingTime() const;
38
39 HttpHeader mergeOfIcapHeaders; ///< Merge of REQMOD and RESPMOD responses. If both responses contain the header, the one from the last response will be used
40 HttpHeader lastIcapHeader; ///< Last received reply from ICAP server
41 String rfc931; ///< the username from ident
42 #if USE_SSL
43 String ssluser; ///< the username from SSL
44 #endif
45 log_type logType; ///< the squid request status (TCP_MISS etc)
46
47 String log_uri; ///< the request uri
48 size_t req_sz; ///< the request size
49
50 private:
51 void assign(const History &);
52
53 int currentTime() const; ///< time since current start or zero
54
55 timeval currentStart; ///< when the current processing interval started
56 int pastTime; ///< sum of closed processing interval durations
57 int concurrencyLevel; ///< number of concurrent processing threads
58 };
59
60 } // namespace Icap
61 } // namespace Adaptation
62
63 #endif /*SQUID_HISTORY_H*/