]>
Commit | Line | Data |
---|---|---|
bbc27441 AJ |
1 | /* |
2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors | |
3 | * | |
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. | |
7 | */ | |
8 | ||
e1f7507e AJ |
9 | #ifndef SQUID_CLIENTREQUESTCONTEXT_H |
10 | #define SQUID_CLIENTREQUESTCONTEXT_H | |
11 | ||
8bf217bd | 12 | #include "base/RefCount.h" |
e1f7507e | 13 | #include "cbdata.h" |
24438ec5 | 14 | #include "helper/forward.h" |
582c2af2 | 15 | #include "ipcache.h" |
e1f7507e | 16 | |
a83c6ed6 AR |
17 | #if USE_ADAPTATION |
18 | #include "adaptation/forward.h" | |
0f305536 | 19 | #endif |
20 | ||
582c2af2 FC |
21 | class ACLChecklist; |
22 | class ClientHttpRequest; | |
23 | class DnsLookupDetails; | |
24 | class ErrorState; | |
25 | ||
0f305536 | 26 | class ClientRequestContext : public RefCountable |
27 | { | |
28 | ||
29 | public: | |
0f305536 | 30 | ClientRequestContext(ClientHttpRequest *); |
31 | ~ClientRequestContext(); | |
32 | ||
33 | bool httpStateIsValid(); | |
fe97983f AJ |
34 | void hostHeaderVerify(); |
35 | void hostHeaderIpVerify(const ipcache_addrs* ia, const DnsLookupDetails &dns); | |
05b28f84 | 36 | void hostHeaderVerifyFailed(const char *A, const char *B); |
0f305536 | 37 | void clientAccessCheck(); |
533493da | 38 | void clientAccessCheck2(); |
2efeb0b7 | 39 | void clientAccessCheckDone(const allow_t &answer); |
0f305536 | 40 | void clientRedirectStart(); |
24438ec5 | 41 | void clientRedirectDone(const Helper::Reply &reply); |
a8a0b1c2 | 42 | void clientStoreIdStart(); |
24438ec5 | 43 | void clientStoreIdDone(const Helper::Reply &reply); |
0f305536 | 44 | void checkNoCache(); |
2efeb0b7 | 45 | void checkNoCacheDone(const allow_t &answer); |
a83c6ed6 | 46 | #if USE_ADAPTATION |
0f305536 | 47 | |
a83c6ed6 | 48 | void adaptationAccessCheck(); |
0f305536 | 49 | #endif |
cb4f4424 | 50 | #if USE_OPENSSL |
e0c0d54c CT |
51 | /** |
52 | * Initiates and start the acl checklist to check if the a CONNECT | |
53 | * request must be bumped. | |
54 | \retval true if the acl check scheduled, false if no ssl-bump required | |
55 | */ | |
56 | bool sslBumpAccessCheck(); | |
57 | /// The callback function for ssl-bump access check list | |
ed6163ef | 58 | void sslBumpAccessCheckDone(const allow_t &answer); |
e0c0d54c | 59 | #endif |
0f305536 | 60 | |
61 | ClientHttpRequest *http; | |
62 | ACLChecklist *acl_checklist; /* need ptr back so we can unreg if needed */ | |
63 | int redirect_state; | |
a8a0b1c2 | 64 | int store_id_state; |
0f305536 | 65 | |
d06e17ea AJ |
66 | /** |
67 | * URL-rewrite/redirect helper may return BH for internal errors. | |
68 | * We attempt to recover by trying the lookup again, but limit the | |
69 | * number of retries to prevent lag and lockups. | |
70 | * This tracks the number of previous failures for the current context. | |
71 | */ | |
72 | uint8_t redirect_fail_count; | |
a8a0b1c2 | 73 | uint8_t store_id_fail_count; |
d06e17ea | 74 | |
fe97983f | 75 | bool host_header_verify_done; |
57abaac0 | 76 | bool http_access_done; |
533493da | 77 | bool adapted_http_access_done; |
a83c6ed6 | 78 | #if USE_ADAPTATION |
a83c6ed6 | 79 | bool adaptation_acl_check_done; |
0f305536 | 80 | #endif |
57abaac0 | 81 | bool redirect_done; |
a8a0b1c2 | 82 | bool store_id_done; |
5d2136fa | 83 | bool no_cache_done; |
57abaac0 | 84 | bool interpreted_req_hdrs; |
425de4c8 AJ |
85 | bool tosToClientDone; |
86 | bool nfmarkToClientDone; | |
cb4f4424 | 87 | #if USE_OPENSSL |
e0c0d54c CT |
88 | bool sslBumpCheckDone; |
89 | #endif | |
7a957a93 AR |
90 | ErrorState *error; ///< saved error page for centralized/delayed processing |
91 | bool readNextRequest; ///< whether Squid should read after error handling | |
0f305536 | 92 | |
9d5e7196 | 93 | private: |
f49c09b2 | 94 | CBDATA_CLASS2(ClientRequestContext); |
0f305536 | 95 | }; |
96 | ||
e1f7507e | 97 | #endif /* SQUID_CLIENTREQUESTCONTEXT_H */ |