From 253ed8bae2267f968567b383cbd00d9f44ba3204 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Tue, 19 Oct 2010 23:40:28 -0600 Subject: [PATCH] Author: Alex Rousskov Added debugging to track HttpRequest and AsyncJob memory leaks. This change is related to Squid bug #2964. Based on lp 3p1-rock branch, r9611 and r9612. --- src/HttpRequest.cc | 3 +++ src/base/AsyncJob.cc | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index ca1637e0ae..58bbe95bc6 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -51,6 +51,8 @@ HttpRequest::HttpRequest() : HttpMsg(hoRequest) HttpRequest::HttpRequest(const HttpRequestMethod& aMethod, protocol_t aProtocol, const char *aUrlpath) : HttpMsg(hoRequest) { + static unsigned int id = 1; + debugs(93,7, HERE << "constructed, this=" << this << " id=" << ++id); init(); initHTTP(aMethod, aProtocol, aUrlpath); } @@ -58,6 +60,7 @@ HttpRequest::HttpRequest(const HttpRequestMethod& aMethod, protocol_t aProtocol, HttpRequest::~HttpRequest() { clean(); + debugs(93,7, HERE << "destructed, this=" << this); } void diff --git a/src/base/AsyncJob.cc b/src/base/AsyncJob.cc index 85b2a31350..a726d61ed8 100644 --- a/src/base/AsyncJob.cc +++ b/src/base/AsyncJob.cc @@ -22,12 +22,14 @@ AsyncJob::Pointer AsyncJob::Start(AsyncJob *j) AsyncJob::AsyncJob(const char *aTypeName): typeName(aTypeName), inCall(NULL), id(++TheLastId) { - debugs(93,3, "AsyncJob of type " << typeName << " constructed, this=" << this << - " [async" << id << ']'); + debugs(93,5, "AsyncJob constructed, this=" << this << + " type=" << typeName << " [job" << id << ']'); } AsyncJob::~AsyncJob() { + debugs(93,5, "AsyncJob destructed, this=" << this << + " type=" << typeName << " [job" << id << ']'); } void AsyncJob::start() -- 2.47.2