Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 0f9305dc685ee9cc7aa4dfca10afda3fb1a1ffb7 1 parent 2b6a5f6
James Peach jpeach authored
Showing with 3 additions and 21 deletions.
  1. +2 −0  CHANGES
  2. +1 −21 proxy/ReverseProxy.cc
2  CHANGES
View
@@ -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 <sunwei@yahoo-inc.com>
22 proxy/ReverseProxy.cc
View
@@ -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 {
Please sign in to comment.
Something went wrong with that request. Please try again.