]> git.ipfire.org Git - thirdparty/squid.git/blame - src/ClientRequestContext.h
Maintenance: automate header guards 2/3 (#1655)
[thirdparty/squid.git] / src / ClientRequestContext.h
CommitLineData
bbc27441 1/*
b8ae064d 2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
bbc27441
AJ
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
ff9d9458
FC
9#ifndef SQUID_SRC_CLIENTREQUESTCONTEXT_H
10#define SQUID_SRC_CLIENTREQUESTCONTEXT_H
e1f7507e 11
a7b75c64 12#include "acl/forward.h"
8bf217bd 13#include "base/RefCount.h"
e1f7507e 14#include "cbdata.h"
a7b75c64 15#include "defines.h"
4a3b98d7 16#include "dns/forward.h"
24438ec5 17#include "helper/forward.h"
582c2af2 18#include "ipcache.h"
e1f7507e 19
a83c6ed6
AR
20#if USE_ADAPTATION
21#include "adaptation/forward.h"
0f305536 22#endif
23
582c2af2
FC
24class ACLChecklist;
25class ClientHttpRequest;
582c2af2
FC
26class ErrorState;
27
0f305536 28class ClientRequestContext : public RefCountable
29{
5c2f68b7 30 CBDATA_CLASS(ClientRequestContext);
0f305536 31
32public:
0f305536 33 ClientRequestContext(ClientHttpRequest *);
337b9aa4 34 ~ClientRequestContext() override;
0f305536 35
36 bool httpStateIsValid();
fe97983f 37 void hostHeaderVerify();
1d1457f2 38 void hostHeaderIpVerify(const ipcache_addrs *, const Dns::LookupDetails &);
05b28f84 39 void hostHeaderVerifyFailed(const char *A, const char *B);
0f305536 40 void clientAccessCheck();
533493da 41 void clientAccessCheck2();
1d1457f2 42 void clientAccessCheckDone(const Acl::Answer &);
0f305536 43 void clientRedirectStart();
1d1457f2 44 void clientRedirectDone(const Helper::Reply &);
a8a0b1c2 45 void clientStoreIdStart();
1d1457f2 46 void clientStoreIdDone(const Helper::Reply &);
0f305536 47 void checkNoCache();
1d1457f2 48 void checkNoCacheDone(const Acl::Answer &);
a83c6ed6 49#if USE_ADAPTATION
a83c6ed6 50 void adaptationAccessCheck();
0f305536 51#endif
cb4f4424 52#if USE_OPENSSL
e0c0d54c 53 /**
1d1457f2 54 * Initiates and start the acl checklist to check if the CONNECT
e0c0d54c 55 * request must be bumped.
1d1457f2
AJ
56 * \retval true if the acl check scheduled
57 * \retval false if no ssl-bump required
e0c0d54c
CT
58 */
59 bool sslBumpAccessCheck();
60 /// The callback function for ssl-bump access check list
329c128c 61 void sslBumpAccessCheckDone(const Acl::Answer &answer);
e0c0d54c 62#endif
0f305536 63
64 ClientHttpRequest *http;
1d1457f2
AJ
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;
0f305536 68
1d1457f2
AJ
69 bool host_header_verify_done = false;
70 bool http_access_done = false;
71 bool adapted_http_access_done = false;
a83c6ed6 72#if USE_ADAPTATION
1d1457f2 73 bool adaptation_acl_check_done = false;
0f305536 74#endif
1d1457f2
AJ
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;
cb4f4424 80#if USE_OPENSSL
1d1457f2 81 bool sslBumpCheckDone = false;
e0c0d54c 82#endif
45b6522e 83
1d1457f2 84 bool readNextRequest = false; ///< whether Squid should read after error handling
45b6522e
TL
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
0f305536 90};
91
ff9d9458 92#endif /* SQUID_SRC_CLIENTREQUESTCONTEXT_H */
f53969cc 93