Skip to content

Commit

Permalink
API to retrieve NoStore set by plugins (apache#7439)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmamidi authored Feb 2, 2021
1 parent 941b923 commit 6318dba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/ts/ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,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);
Expand Down
9 changes: 9 additions & 0 deletions src/traffic_server/InkAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5596,6 +5596,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)
{
Expand Down

0 comments on commit 6318dba

Please sign in to comment.