]> git.ipfire.org Git - thirdparty/squid.git/blame - src/ssl/ServerBump.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / ssl / ServerBump.cc
CommitLineData
fd4624d7
CT
1/*
2 * $Id$
3 *
4 * DEBUG: section 33 Client-side Routines
5 *
6 */
7
8#include "squid.h"
9
10#include "client_side.h"
11#include "forward.h"
582c2af2 12#include "protos.h"
fd4624d7
CT
13#include "ssl/ServerBump.h"
14#include "Store.h"
15
fd4624d7
CT
16CBDATA_NAMESPACED_CLASS_INIT(Ssl, ServerBump);
17
2bd84e5f 18Ssl::ServerBump::ServerBump(HttpRequest *fakeRequest, StoreEntry *e):
87f237a9
A
19 request(fakeRequest),
20 sslErrors(NULL)
fd4624d7
CT
21{
22 debugs(33, 4, HERE << "will peek at " << request->GetHost() << ':' << request->port);
23 const char *uri = urlCanonical(request);
2bd84e5f
CT
24 if (e) {
25 entry = e;
26 entry->lock();
27 } else
28 entry = storeCreateEntry(uri, uri, request->flags, request->method);
fd4624d7
CT
29 // We do not need to be a client because the error contents will be used
30 // later, but an entry without any client will trim all its contents away.
31 sc = storeClientListAdd(entry, this);
32}
33
34Ssl::ServerBump::~ServerBump()
35{
36 debugs(33, 4, HERE << "destroying");
37 if (entry) {
38 debugs(33, 4, HERE << *entry);
39 storeUnregister(sc, entry, this);
40 entry->unlock();
41 }
7a957a93 42 cbdataReferenceDone(sslErrors);
fd4624d7
CT
43}
44