AsyncJob("Ssl::ServerPeeker"),
initiator(anInitiator),
clientConnection(anInitiator->clientConnection),
- request(new HttpRequest)
+ request(new HttpRequest),
+ entry(NULL),
+ sc(NULL)
{
debugs(33, 4, HERE << "will peek at " << host << ':' << port);
request->flags.sslPeek = 1;
request->clientConnectionManager = initiator;
const char *uri = urlCanonical(request);
entry = storeCreateEntry(uri, uri, request->flags, request->method);
+ // We do not need to be a client because the error contents will be used
+ // later, but an entry without any client will trim all its contents away.
+ sc = storeClientListAdd(entry, this);
}
Ssl::ServerPeeker::~ServerPeeker()
{
- if (entry)
+ if (entry) {
+ debugs(33, 4, HERE << "stopped peeking via " << *entry);
+ storeUnregister(sc, entry, this);
entry->unlock();
+ }
}
void
HttpRequest::Pointer request;
StoreEntry *entry; ///< for receiving Squid-generated error messages
+ store_client *sc; ///< dummy client to prevent entry trimming
CBDATA_CLASS2(ServerPeeker);
};