AtStep.cc
Go to the documentation of this file.
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 #include "squid.h"
10 
11 #include "acl/AtStep.h"
12 #include "acl/FilledChecklist.h"
13 #include "client_side.h"
14 #include "http/Stream.h"
15 #if USE_OPENSSL
16 #include "ssl/ServerBump.h"
17 #endif
18 
19 int
21 {
22  const auto checklist = Filled(ch);
23 
24 #if USE_OPENSSL
25  // We use step1 for all these very different cases:
26  // - The transaction is not subject to ssl_bump rules (if any).
27  // - No ssl_bump action has matched yet.
28  // - The ssl_bump client-first action has already matched.
29  // - Another ssl_bump action has already matched, but
30  // ConnStateData::serverBump() has not been built yet.
31  auto currentSslBumpStep = XactionStep::tlsBump1;
32 
33  if (const auto mgr = checklist->conn()) {
34  if (const auto serverBump = mgr->serverBump())
35  currentSslBumpStep = serverBump->step;
36  }
37 
38  if (data->match(currentSslBumpStep))
39  return 1;
40 #endif // USE_OPENSSL
41 
43  if (!checklist->request)
44  return 0; // we have warned about the missing request earlier
45 
46  if (!checklist->request->masterXaction) {
47  debugs(28, DBG_IMPORTANT, "ERROR: Squid BUG: at_step GeneratingCONNECT ACL is missing master transaction info. Assuming mismatch.");
48  return 0;
49  }
50 
51  return checklist->request->masterXaction->generatingConnect ? 1 : 0;
52  }
53 
54  return 0;
55 }
56 
ACLFilledChecklist * Filled(ACLChecklist *checklist)
convenience and safety wrapper for dynamic_cast<ACLFilledChecklist*>
#define DBG_IMPORTANT
Definition: Stream.h:38
int match(ACLChecklist *) override
Matches the actual data in checklist against this Acl::Node.
Definition: AtStep.cc:20
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Stream.h:192

 

Introduction

Documentation

Support

Miscellaneous