You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2016/05/20 23:11:02 UTC
[trafficserver] 06/28: TS-4046: Better fix for cleaning up the
client response for intercept plugins.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch 6.2.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit 5f940c674b1d1c4680d637da1ad8b81e909ff013
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Tue Apr 19 10:17:22 2016 -0500
TS-4046: Better fix for cleaning up the client response for intercept plugins.
(cherry picked from commit 608775e1ceccba64f5dfd75957f4a24276fba755)
---
proxy/hdrs/HTTP.h | 7 +++----
proxy/http/HttpTransact.cc | 3 ++-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/proxy/hdrs/HTTP.h b/proxy/hdrs/HTTP.h
index e457f61..ae20b48 100644
--- a/proxy/hdrs/HTTP.h
+++ b/proxy/hdrs/HTTP.h
@@ -507,7 +507,7 @@ public:
int valid() const;
void create(HTTPType polarity, HdrHeap *heap = NULL);
- void destroy();
+ void clear();
void reset();
void copy(const HTTPHdr *hdr);
void copy_shallow(const HTTPHdr *hdr);
@@ -796,13 +796,12 @@ HTTPHdr::create(HTTPType polarity, HdrHeap *heap)
}
inline void
-HTTPHdr::destroy()
+HTTPHdr::clear()
{
if (m_http && m_http->m_polarity == HTTP_TYPE_REQUEST) {
m_url_cached.clear();
}
- // Removing the only pointers to this data therefore it needs to get cleaned up or leak.
- this->HdrHeapSDKHandle::destroy();
+ this->HdrHeapSDKHandle::clear();
m_http = NULL;
m_mime = NULL;
}
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 1500f0a..9b06ede 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -934,7 +934,8 @@ done:
HTTP_INCREMENT_DYN_STAT(http_invalid_client_requests_stat);
TRANSACT_RETURN(SM_ACTION_SEND_ERROR_CACHE_NOOP, NULL);
} else {
- s->hdr_info.client_response.destroy(); // anything previously set is invalid from this point forward
+ s->hdr_info.client_response.destroy(); // release the underlying memory.
+ s->hdr_info.client_response.clear(); // clear the pointers.
DebugTxn("http_trans", "END HttpTransact::EndRemapRequest");
if (s->is_upgrade_request && s->post_remap_upgrade_return_point) {
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.