You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ez...@apache.org on 2021/04/29 20:02:50 UTC
[trafficserver] branch 8.1.x updated: API to retrieve NoStore set
by plugins (#7439) (#7763)
This is an automated email from the ASF dual-hosted git repository.
eze pushed a commit to branch 8.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/8.1.x by this push:
new c26c9a3 API to retrieve NoStore set by plugins (#7439) (#7763)
c26c9a3 is described below
commit c26c9a3fd8010f2d13ebf1fb57e12b00efe802f5
Author: Vijay Mamidi <vi...@yahoo.com>
AuthorDate: Thu Apr 29 13:02:30 2021 -0700
API to retrieve NoStore set by plugins (#7439) (#7763)
(cherry picked from commit 6318dba92fdca9f1a0fe5a402bcaf50b58ca8792)
---
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 3db5637..a58ccbd 100644
--- a/include/ts/ts.h
+++ b/include/ts/ts.h
@@ -1291,6 +1291,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 b574f1d..75fb418 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -5247,6 +5247,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)
{