]> git.ipfire.org Git - thirdparty/squid.git/blame_incremental - src/ClientRequestContext.h
Maintenance: automate header guards 2/3 (#1655)
[thirdparty/squid.git] / src / ClientRequestContext.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 1996-2023 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
9#ifndef SQUID_SRC_CLIENTREQUESTCONTEXT_H
10#define SQUID_SRC_CLIENTREQUESTCONTEXT_H
11
12#include "acl/forward.h"
13#include "base/RefCount.h"
14#include "cbdata.h"
15#include "defines.h"
16#include "dns/forward.h"
17#include "helper/forward.h"
18#include "ipcache.h"
19
20#if USE_ADAPTATION
21#include "adaptation/forward.h"
22#endif
23
24class ACLChecklist;
25class ClientHttpRequest;
26class ErrorState;
27
28class ClientRequestContext : public RefCountable
29{
30 CBDATA_CLASS(ClientRequestContext);
31
32public:
33 ClientRequestContext(ClientHttpRequest *);
34 ~ClientRequestContext() override;
35
36 bool httpStateIsValid();
37 void hostHeaderVerify();
38 void hostHeaderIpVerify(const ipcache_addrs *, const Dns::LookupDetails &);
39 void hostHeaderVerifyFailed(const char *A, const char *B);
40 void clientAccessCheck();
41 void clientAccessCheck2();
42 void clientAccessCheckDone(const Acl::Answer &);
43 void clientRedirectStart();
44 void clientRedirectDone(const Helper::Reply &);
45 void clientStoreIdStart();
46 void clientStoreIdDone(const Helper::Reply &);
47 void checkNoCache();
48 void checkNoCacheDone(const Acl::Answer &);
49#if USE_ADAPTATION
50 void adaptationAccessCheck();
51#endif
52#if USE_OPENSSL
53 /**
54 * Initiates and start the acl checklist to check if the CONNECT
55 * request must be bumped.
56 * \retval true if the acl check scheduled
57 * \retval false if no ssl-bump required
58 */
59 bool sslBumpAccessCheck();
60 /// The callback function for ssl-bump access check list
61 void sslBumpAccessCheckDone(const Acl::Answer &answer);
62#endif
63
64 ClientHttpRequest *http;
65 ACLChecklist *acl_checklist = nullptr; ///< need ptr back so we can unregister if needed
66 int redirect_state = REDIRECT_NONE;
67 int store_id_state = REDIRECT_NONE;
68
69 bool host_header_verify_done = false;
70 bool http_access_done = false;
71 bool adapted_http_access_done = false;
72#if USE_ADAPTATION
73 bool adaptation_acl_check_done = false;
74#endif
75 bool redirect_done = false;
76 bool store_id_done = false;
77 bool no_cache_done = false;
78 bool interpreted_req_hdrs = false;
79 bool toClientMarkingDone = false;
80#if USE_OPENSSL
81 bool sslBumpCheckDone = false;
82#endif
83
84 bool readNextRequest = false; ///< whether Squid should read after error handling
85 ErrorState *error = nullptr; ///< saved error page for centralized/delayed processing
86
87#if FOLLOW_X_FORWARDED_FOR
88 size_t currentXffHopNumber = 0; ///< number of X-Forwarded-For header values processed so far
89#endif
90};
91
92#endif /* SQUID_SRC_CLIENTREQUESTCONTEXT_H */
93