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