Repository: trafficserver
Updated Branches:
  refs/heads/master c106b8554 -> 26d611c1a


TS-4158 Adds appropriate releases of URL MLocs

This closes #491


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/26d611c1
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/26d611c1
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/26d611c1

Branch: refs/heads/master
Commit: 26d611c1a4e888f92bc76ca2024bfb91064bc433
Parents: c106b85
Author: Leif Hedstrom <[email protected]>
Authored: Wed Jan 27 15:54:56 2016 -0700
Committer: Leif Hedstrom <[email protected]>
Committed: Sun Feb 21 16:54:30 2016 -0700

----------------------------------------------------------------------
 plugins/experimental/background_fetch/background_fetch.cc | 2 ++
 plugins/experimental/channel_stats/channel_stats.cc       | 1 +
 plugins/experimental/escalate/escalate.cc                 | 3 +--
 plugins/header_rewrite/expander.cc                        | 1 +
 4 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/26d611c1/plugins/experimental/background_fetch/background_fetch.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/background_fetch/background_fetch.cc 
b/plugins/experimental/background_fetch/background_fetch.cc
index d8438e4..6b6d9e3 100644
--- a/plugins/experimental/background_fetch/background_fetch.cc
+++ b/plugins/experimental/background_fetch/background_fetch.cc
@@ -244,7 +244,9 @@ BgFetchData::initialize(TSMBuffer request, TSMLoc req_hdr, 
TSHttpTxn txnp)
       char *url = TSUrlStringGet(mbuf, url_loc, &len);
 
       _url.append(url, len); // Save away the URL for later use when acquiring 
lock
+
       TSfree(static_cast<void *>(url));
+      TSHandleMLocRelease(request, TS_NULL_MLOC, purl);
 
       if (TS_SUCCESS == TSHttpHdrUrlSet(mbuf, hdr_loc, url_loc)) {
         // Make sure we have the correct Host: header for this request.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/26d611c1/plugins/experimental/channel_stats/channel_stats.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/channel_stats/channel_stats.cc 
b/plugins/experimental/channel_stats/channel_stats.cc
index b971d72..bfc11a6 100644
--- a/plugins/experimental/channel_stats/channel_stats.cc
+++ b/plugins/experimental/channel_stats/channel_stats.cc
@@ -361,6 +361,7 @@ get_pristine_host(TSHttpTxn txnp, TSMBuffer bufp, 
std::string &host)
   }
 
   pristine_port = TSUrlPortGet(bufp, purl_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, purl_loc);
   host = std::string(pristine_host, pristine_host_len);
   if (pristine_port != 80) {
     char buf[12];

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/26d611c1/plugins/experimental/escalate/escalate.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/escalate/escalate.cc 
b/plugins/experimental/escalate/escalate.cc
index 4a9b1c0..c68c0b5 100644
--- a/plugins/experimental/escalate/escalate.cc
+++ b/plugins/experimental/escalate/escalate.cc
@@ -129,13 +129,12 @@ EscalateResponse(TSCont cont, TSEvent event, void *edata)
     if (es->use_pristine) {
       if (TS_SUCCESS == TSHttpTxnPristineUrlGet(txn, &mbuf, &url)) {
         url_str = MakeEscalateUrl(mbuf, url, entry->second.target.c_str(), 
entry->second.target.size(), url_len);
-        printf("STRING is %.*s\n", url_len, url_str);
+        TSHandleMLocRelease(mbuf, TS_NULL_MLOC, url);
       }
     } else {
       if (TS_SUCCESS == TSHttpTxnClientReqGet(txn, &mbuf, &hdrp)) {
         if (TS_SUCCESS == TSHttpHdrUrlGet(mbuf, hdrp, &url)) {
           url_str = MakeEscalateUrl(mbuf, url, entry->second.target.c_str(), 
entry->second.target.size(), url_len);
-          printf("Old code STRING is %.*s\n", url_len, url_str);
         }
         // Release the request MLoc
         TSHandleMLocRelease(mbuf, TS_NULL_MLOC, hdrp);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/26d611c1/plugins/header_rewrite/expander.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/expander.cc 
b/plugins/header_rewrite/expander.cc
index 5d867e3..8c33a2c 100644
--- a/plugins/header_rewrite/expander.cc
+++ b/plugins/header_rewrite/expander.cc
@@ -66,6 +66,7 @@ VariableExpander::expand(const Resources &res)
       if (TSHttpTxnPristineUrlGet(res.txnp, &bufp, &url_loc) == TS_SUCCESS) {
         int len;
         resolved_variable = TSUrlSchemeGet(bufp, url_loc, &len);
+        TSHandleMLocRelease(bufp, TS_NULL_MLOC, url_loc);
       }
     } else if (variable == "%<port>") {
       // Original port of the incoming request

Reply via email to