]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ssl/ServerBump.cc
merge from trunk
[thirdparty/squid.git] / src / ssl / ServerBump.cc
1 /*
2 * DEBUG: section 33 Client-side Routines
3 *
4 */
5
6 #include "squid.h"
7
8 #include "client_side.h"
9 #include "FwdState.h"
10 #include "ssl/ServerBump.h"
11 #include "Store.h"
12 #include "StoreClient.h"
13 #include "URL.h"
14
15 CBDATA_NAMESPACED_CLASS_INIT(Ssl, ServerBump);
16
17 Ssl::ServerBump::ServerBump(HttpRequest *fakeRequest, StoreEntry *e, Ssl::BumpMode md):
18 request(fakeRequest),
19 sslErrors(NULL),
20 mode(md)
21 {
22 debugs(33, 4, HERE << "will peek at " << request->GetHost() << ':' << request->port);
23 const char *uri = urlCanonical(request.getRaw());
24 if (e) {
25 entry = e;
26 entry->lock("Ssl::ServerBump");
27 } else
28 entry = storeCreateEntry(uri, uri, request->flags, request->method);
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
34 Ssl::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("Ssl::ServerBump");
41 }
42 cbdataReferenceDone(sslErrors);
43 }
44