]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ssl/ServerBump.cc
Enable source-formatting tools to collapse multiple whitelines in the source to one.
[thirdparty/squid.git] / src / ssl / ServerBump.cc
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"
12 #include "protos.h"
13 #include "ssl/ServerBump.h"
14 #include "Store.h"
15
16
17 CBDATA_NAMESPACED_CLASS_INIT(Ssl, ServerBump);
18
19
20 Ssl::ServerBump::ServerBump(HttpRequest *fakeRequest, StoreEntry *e):
21 request(fakeRequest),
22 sslErrors(NULL)
23 {
24 debugs(33, 4, HERE << "will peek at " << request->GetHost() << ':' << request->port);
25 const char *uri = urlCanonical(request);
26 if (e) {
27 entry = e;
28 entry->lock();
29 } else
30 entry = storeCreateEntry(uri, uri, request->flags, request->method);
31 // We do not need to be a client because the error contents will be used
32 // later, but an entry without any client will trim all its contents away.
33 sc = storeClientListAdd(entry, this);
34 }
35
36 Ssl::ServerBump::~ServerBump()
37 {
38 debugs(33, 4, HERE << "destroying");
39 if (entry) {
40 debugs(33, 4, HERE << *entry);
41 storeUnregister(sc, entry, this);
42 entry->unlock();
43 }
44 cbdataReferenceDone(sslErrors);
45 }
46