AtStep.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2022 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/AtStepData.h"
13 #include "acl/FilledChecklist.h"
14 #include "client_side.h"
15 #include "http/Stream.h"
16 #if USE_OPENSSL
17 #include "ssl/ServerBump.h"
18 #endif
19 
20 int
22 {
23 #if USE_OPENSSL
24  // We use step1 for all these very different cases:
25  // - The transaction is not subject to ssl_bump rules (if any).
26  // - No ssl_bump action has matched yet.
27  // - The ssl_bump client-first action has already matched.
28  // - Another ssl_bump action has already matched, but
29  // ConnStateData::serverBump() has not been built yet.
30  auto currentSslBumpStep = XactionStep::tlsBump1;
31 
32  if (const auto mgr = checklist->conn()) {
33  if (const auto serverBump = mgr->serverBump())
34  currentSslBumpStep = serverBump->step;
35  }
36 
37  if (data->match(currentSslBumpStep))
38  return 1;
39 #endif // USE_OPENSSL
40 
42  if (!checklist->request)
43  return 0; // we have warned about the missing request earlier
44 
45  if (!checklist->request->masterXaction) {
46  debugs(28, DBG_IMPORTANT, "ERROR: Squid BUG: at_step GeneratingCONNECT ACL is missing master transaction info. Assuming mismatch.");
47  return 0;
48  }
49 
50  return checklist->request->masterXaction->generatingConnect ? 1 : 0;
51  }
52 
53  return 0;
54 }
55 
virtual int match(ACLData< MatchType > *&, ACLFilledChecklist *) override
Definition: AtStep.cc:21
virtual bool match(M)=0
HttpRequest * request
ConnStateData * conn() const
The client connection manager.
MasterXaction::Pointer masterXaction
the master transaction this request belongs to. Never nil.
Definition: HttpRequest.h:238
bool generatingConnect
whether we are currently creating a CONNECT header (to be sent to peer)
Definition: MasterXaction.h:72
#define DBG_IMPORTANT
Definition: Stream.h:41
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Stream.h:196

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors