Skip to content

Commit c26c9a3

Browse files
authored
API to retrieve NoStore set by plugins (#7439) (#7763)
(cherry picked from commit 6318dba)
1 parent 84f60f6 commit c26c9a3

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

include/ts/ts.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,13 @@ tsapi void TSHttpTxnReqCacheableSet(TSHttpTxn txnp, int flag);
12911291
*/
12921292
tsapi TSReturnCode TSHttpTxnServerRespNoStoreSet(TSHttpTxn txnp, int flag);
12931293

1294+
/** Get flag indicating whether or not to cache the server response for
1295+
given TSHttpTxn
1296+
@param txnp The transaction whose server response you do not want to store.
1297+
1298+
@return TS_SUCCESS.
1299+
*/
1300+
tsapi bool TSHttpTxnServerRespNoStoreGet(TSHttpTxn txnp);
12941301
tsapi TSReturnCode TSFetchPageRespGet(TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset);
12951302
tsapi char *TSFetchRespGet(TSHttpTxn txnp, int *length);
12961303
tsapi TSReturnCode TSHttpTxnCacheLookupStatusGet(TSHttpTxn txnp, int *lookup_status);

src/traffic_server/InkAPI.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5247,6 +5247,15 @@ TSHttpTxnServerRespNoStoreSet(TSHttpTxn txnp, int flag)
52475247
return TS_SUCCESS;
52485248
}
52495249

5250+
bool
5251+
TSHttpTxnServerRespNoStoreGet(TSHttpTxn txnp)
5252+
{
5253+
sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
5254+
5255+
HttpTransact::State *s = &(((HttpSM *)txnp)->t_state);
5256+
return s->api_server_response_no_store;
5257+
}
5258+
52505259
TSReturnCode
52515260
TSHttpTxnServerRespIgnore(TSHttpTxn txnp)
52525261
{

0 commit comments

Comments
 (0)