Updated Branches:
  refs/heads/master 2b6a5f6bb -> 0f9305dc6

TS-2415: use standard continuations to release UrlRewrite objects

UrlRewrite uses a custom continuation to release the old object
after it is no longer needed. We can use library code for this
instead. Use new_Deleter to free the old UrlRewrite object.


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

Branch: refs/heads/master
Commit: 0f9305dc685ee9cc7aa4dfca10afda3fb1a1ffb7
Parents: 2b6a5f6
Author: James Peach <[email protected]>
Authored: Tue Dec 3 11:34:22 2013 -0800
Committer: James Peach <[email protected]>
Committed: Tue Dec 3 21:29:02 2013 -0800

----------------------------------------------------------------------
 CHANGES               |  2 ++
 proxy/ReverseProxy.cc | 22 +---------------------
 2 files changed, 3 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0f9305dc/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index fa8bb06..bac07c9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 Changes with Apache Traffic Server 4.2.0
 
 
+  *) [TS-2415] Use standard continuations to release UrlRewrite objects.
+
   *) [TS-2413] Release memory for idle SSL connections.
    Author: Wei Sun <[email protected]>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0f9305dc/proxy/ReverseProxy.cc
----------------------------------------------------------------------
diff --git a/proxy/ReverseProxy.cc b/proxy/ReverseProxy.cc
index 51c3664..bdfecbd 100644
--- a/proxy/ReverseProxy.cc
+++ b/proxy/ReverseProxy.cc
@@ -146,26 +146,6 @@ struct UR_UpdateContinuation: public Continuation
   }
 };
 
-struct UR_FreerContinuation;
-typedef int (UR_FreerContinuation::*UR_FreerContHandler) (int, void *);
-
-/** Used to free url rewrite class. */
-struct UR_FreerContinuation: public Continuation
-{
-  UrlRewrite *p;
-  int freeEvent(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
-  {
-    Debug("url_rewrite", "Deleting old remap.config table");
-    delete p;
-    delete this;
-    return EVENT_DONE;
-  }
-  UR_FreerContinuation(UrlRewrite * ap):Continuation(new_ProxyMutex()), p(ap)
-  {
-    SET_HANDLER((UR_FreerContHandler) & UR_FreerContinuation::freeEvent);
-  }
-};
-
 /**
   Called when the remap.config file changes. Since it called infrequently,
   we do the load of new file as blocking I/O and lock aquire is also
@@ -180,7 +160,7 @@ reloadUrlRewrite()
   Debug("url_rewrite", "remap.config updated, reloading...");
   newTable = NEW(new UrlRewrite());
   if (newTable->is_valid()) {
-    eventProcessor.schedule_in(new UR_FreerContinuation(rewrite_table), 
URL_REWRITE_TIMEOUT, ET_TASK);
+    new_Deleter(rewrite_table, URL_REWRITE_TIMEOUT);
     Debug("url_rewrite", "remap.config done reloading!");
     ink_atomic_swap(&rewrite_table, newTable);
   } else {

Reply via email to