This is an automated email from the ASF dual-hosted git repository.

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

commit 2926a69e034c5302b02199fe639081b11cd3966d
Author: Vijay Mamidi <[email protected]>
AuthorDate: Tue Feb 2 14:48:42 2021 -0800

    API to retrieve NoStore set by plugins (#7439)
---
 include/ts/ts.h              | 7 +++++++
 src/traffic_server/InkAPI.cc | 9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/ts/ts.h b/include/ts/ts.h
index 5fef637..4d3b4c2 100644
--- a/include/ts/ts.h
+++ b/include/ts/ts.h
@@ -1380,6 +1380,13 @@ tsapi void TSHttpTxnReqCacheableSet(TSHttpTxn txnp, int 
flag);
 */
 tsapi TSReturnCode TSHttpTxnServerRespNoStoreSet(TSHttpTxn txnp, int flag);
 
+/** Get flag indicating whether or not to cache the server response for
+    given TSHttpTxn
+    @param txnp The transaction whose server response you do not want to store.
+
+    @return TS_SUCCESS.
+*/
+tsapi bool TSHttpTxnServerRespNoStoreGet(TSHttpTxn txnp);
 tsapi TSReturnCode TSFetchPageRespGet(TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc 
*offset);
 tsapi char *TSFetchRespGet(TSHttpTxn txnp, int *length);
 tsapi TSReturnCode TSHttpTxnCacheLookupStatusGet(TSHttpTxn txnp, int 
*lookup_status);
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 0d6c20c..50e2fdd 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -5659,6 +5659,15 @@ TSHttpTxnServerRespNoStoreSet(TSHttpTxn txnp, int flag)
   return TS_SUCCESS;
 }
 
+bool
+TSHttpTxnServerRespNoStoreGet(TSHttpTxn txnp)
+{
+  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
+
+  HttpTransact::State *s = &(((HttpSM *)txnp)->t_state);
+  return s->api_server_response_no_store;
+}
+
 TSReturnCode
 TSHttpTxnServerRespIgnore(TSHttpTxn txnp)
 {

Reply via email to