trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] branch master updated: Changes where we turn off the cacheability of the response
Date Thu, 13 Apr 2017 04:03:54 GMT
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  01d997e   Changes where we turn off the cacheability of the response
01d997e is described below

commit 01d997e3b8661fc577db636c9935b563b761f36e
Author: Leif Hedstrom <zwoop@apache.org>
AuthorDate: Fri Apr 7 19:03:20 2017 -0600

    Changes where we turn off the cacheability of the response
    
    This avoids the extra hook on the response, and perhaps (??)
    also reduces some overhead on cache access.
---
 plugins/experimental/cache_promote/cache_promote.cc | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/plugins/experimental/cache_promote/cache_promote.cc b/plugins/experimental/cache_promote/cache_promote.cc
index e009f75..8245605 100644
--- a/plugins/experimental/cache_promote/cache_promote.cc
+++ b/plugins/experimental/cache_promote/cache_promote.cc
@@ -35,7 +35,6 @@
 #define MINIMUM_BUCKET_SIZE 10
 
 static const char *PLUGIN_NAME = "cache_promote";
-TSCont gNocacheCont;
 
 //////////////////////////////////////////////////////////////////////////////////////////////
 // Note that all options for all policies has to go here. Not particularly pretty...
@@ -405,20 +404,6 @@ private:
 };
 
 //////////////////////////////////////////////////////////////////////////////////////////////
-// Little helper continuation, to turn off writing to the cache. ToDo: when we have proper
-// APIs to make requests / responses, we can remove this completely.
-static int
-cont_nocache_response(TSCont contp, TSEvent event, void *edata)
-{
-  TSHttpTxn txnp = static_cast<TSHttpTxn>(edata);
-
-  TSHttpTxnServerRespNoStoreSet(txnp, 1);
-  // Reenable and continue with the state machine.
-  TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
-  return 0;
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////////
 // Main "plugin", a TXN hook in the TS_HTTP_READ_CACHE_HDR_HOOK. Unless the policy allows
 // caching, we will turn off the cache from here on for the TXN.
 //
@@ -446,7 +431,7 @@ cont_handle_policy(TSCont contp, TSEvent event, void *edata)
             TSDebug(PLUGIN_NAME, "cache-status is %d, and leaving cache on (promoted)", obj_status);
           } else {
             TSDebug(PLUGIN_NAME, "cache-status is %d, and turning off the cache (not promoted)",
obj_status);
-            TSHttpTxnHookAdd(txnp, TS_HTTP_READ_RESPONSE_HDR_HOOK, gNocacheCont);
+            TSHttpTxnServerRespNoStoreSet(txnp, 1);
           }
           break;
         default:
@@ -488,8 +473,6 @@ TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
     return TS_ERROR;
   }
 
-  gNocacheCont = TSContCreate(cont_nocache_response, nullptr);
-
   TSDebug(PLUGIN_NAME, "remap plugin is successfully initialized");
   return TS_SUCCESS; /* success */
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message