]>
Commit | Line | Data |
---|---|---|
fd4624d7 | 1 | /* |
bbc27441 | 2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
fd4624d7 | 3 | * |
bbc27441 AJ |
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. | |
fd4624d7 CT |
7 | */ |
8 | ||
bbc27441 AJ |
9 | /* DEBUG: section 33 Client-side Routines */ |
10 | ||
fd4624d7 CT |
11 | #include "squid.h" |
12 | ||
13 | #include "client_side.h" | |
eb13c21e | 14 | #include "FwdState.h" |
fd4624d7 CT |
15 | #include "ssl/ServerBump.h" |
16 | #include "Store.h" | |
e87137f1 | 17 | #include "StoreClient.h" |
b1bd952a | 18 | #include "URL.h" |
fd4624d7 CT |
19 | |
20 | CBDATA_NAMESPACED_CLASS_INIT(Ssl, ServerBump); | |
21 | ||
d620ae0e | 22 | Ssl::ServerBump::ServerBump(HttpRequest *fakeRequest, StoreEntry *e, Ssl::BumpMode md): |
87f237a9 | 23 | request(fakeRequest), |
d620ae0e | 24 | sslErrors(NULL), |
5d65362c CT |
25 | mode(md), |
26 | step(bumpStep1) | |
fd4624d7 CT |
27 | { |
28 | debugs(33, 4, HERE << "will peek at " << request->GetHost() << ':' << request->port); | |
b248c2a3 | 29 | const char *uri = urlCanonical(request.getRaw()); |
2bd84e5f CT |
30 | if (e) { |
31 | entry = e; | |
1bfe9ade | 32 | entry->lock("Ssl::ServerBump"); |
2bd84e5f CT |
33 | } else |
34 | entry = storeCreateEntry(uri, uri, request->flags, request->method); | |
fd4624d7 CT |
35 | // We do not need to be a client because the error contents will be used |
36 | // later, but an entry without any client will trim all its contents away. | |
37 | sc = storeClientListAdd(entry, this); | |
38 | } | |
39 | ||
40 | Ssl::ServerBump::~ServerBump() | |
41 | { | |
42 | debugs(33, 4, HERE << "destroying"); | |
43 | if (entry) { | |
44 | debugs(33, 4, HERE << *entry); | |
45 | storeUnregister(sc, entry, this); | |
1bfe9ade | 46 | entry->unlock("Ssl::ServerBump"); |
fd4624d7 | 47 | } |
7a957a93 | 48 | cbdataReferenceDone(sslErrors); |
fd4624d7 CT |
49 | } |
50 |