Squid Web Cache master
Loading...
Searching...
No Matches
ServerBump.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 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/* DEBUG: section 33 Client-side Routines */
10
11#include "squid.h"
12#include "anyp/Uri.h"
13#include "client_side.h"
14#include "client_side_request.h"
15#include "FwdState.h"
16#include "http/Stream.h"
17#include "ssl/ServerBump.h"
18#include "Store.h"
19#include "StoreClient.h"
20
22
25{
26 assert(http->request);
27 request = http->request;
28 debugs(33, 4, "will peek at " << request->url.authority(true));
29 act.step1 = md;
30 act.step2 = act.step3 = Ssl::bumpNone;
31
32 if (e) {
33 entry = e;
34 entry->lock("Ssl::ServerBump");
35 } else {
36 // XXX: Performance regression. c_str() reallocates
38 const char *uri = uriBuf.c_str();
40 }
41 // We do not need to be a client because the error contents will be used
42 // later, but an entry without any client will trim all its contents away.
44#if USE_DELAY_POOLS
46#endif
47}
48
50{
51 debugs(33, 4, "destroying");
52 if (entry) {
53 debugs(33, 4, *entry);
54 storeUnregister(sc, entry, this);
55 entry->unlock("Ssl::ServerBump");
56 }
57}
58
59void
61{
62 serverSession = s;
63}
64
67{
68 if (!serverSession)
69 return nullptr;
70
71 return static_cast<Security::CertErrors*>(SSL_get_ex_data(serverSession.get(), ssl_ex_index_ssl_errors));
72}
73
XactionStep
Definition XactionStep.h:12
#define assert(EX)
Definition assert.h:17
#define CBDATA_NAMESPACED_CLASS_INIT(namespace, type)
Definition cbdata.h:333
SBuf & authority(bool requirePort=false) const
Definition Uri.cc:721
HttpRequest *const request
static DelayId DelayClient(ClientHttpRequest *, HttpReply *reply=nullptr)
Definition DelayId.cc:64
HttpRequestMethod method
RequestFlags flags
AnyP::Uri url
the request URI
const SBuf & effectiveRequestUri() const
RFC 7230 section 5.5 - Effective Request URI.
Definition SBuf.h:94
const char * c_str()
Definition SBuf.cc:516
struct Ssl::ServerBump::@103 act
bumping actions at various bumping steps
store_client * sc
dummy client to prevent entry trimming
Definition ServerBump.h:67
StoreEntry * entry
Definition ServerBump.h:54
ServerBump(ClientHttpRequest *http, StoreEntry *e=nullptr, Ssl::BumpMode mode=Ssl::bumpServerFirst)
Definition ServerBump.cc:23
Security::CertErrors * sslErrors() const
SSL [certificate validation] errors.
Definition ServerBump.cc:66
void attachServerSession(const Security::SessionPointer &)
Sets the server TLS session object.
Definition ServerBump.cc:60
HttpRequest::Pointer request
faked, minimal request; required by Client API
Definition ServerBump.h:53
void lock(const char *context)
Definition store.cc:445
void setDelayId(DelayId delay_id)
#define debugs(SECTION, LEVEL, CONTENT)
Definition Stream.h:192
int ssl_ex_index_ssl_errors
BumpMode
Definition support.h:132
@ bumpNone
Definition support.h:132
std::shared_ptr< SSL > SessionPointer
Definition Session.h:53
Definition Xaction.cc:40
StoreEntry * storeCreateEntry(const char *url, const char *logUrl, const RequestFlags &flags, const HttpRequestMethod &method)
Definition store.cc:759
int storeUnregister(store_client *sc, StoreEntry *e, void *data)
store_client * storeClientListAdd(StoreEntry *e, void *data)