TS-1389 Replace TSHttpTxnServerRespNoStore() with TSHttpTxnServerRespNoStoreSet(). Author: Phil Sorber
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/146ce519 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/146ce519 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/146ce519 Branch: refs/heads/master Commit: 146ce5196ced9be96bb62e9cd9955ba518205c7b Parents: ed0e0ba Author: Phil Sorber <[email protected]> Authored: Thu Aug 23 12:47:12 2012 -0600 Committer: Leif Hedstrom <[email protected]> Committed: Thu Aug 23 12:47:12 2012 -0600 ---------------------------------------------------------------------- plugins/experimental/rfc5861/rfc5861.c | 2 +- proxy/InkAPI.cc | 4 ++-- proxy/api/ts/experimental.h | 1 - proxy/api/ts/ts.h.in | 16 ++++++++++++++++ 4 files changed, 19 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/146ce519/plugins/experimental/rfc5861/rfc5861.c ---------------------------------------------------------------------- diff --git a/plugins/experimental/rfc5861/rfc5861.c b/plugins/experimental/rfc5861/rfc5861.c index 788ca2f..caeb6b2 100644 --- a/plugins/experimental/rfc5861/rfc5861.c +++ b/plugins/experimental/rfc5861/rfc5861.c @@ -634,7 +634,7 @@ rfc5861_plugin(TSCont cont, TSEvent event, void *edata) { TSDebug(LOG_PREFIX, "Set non-cachable"); //TSHttpTxnRespCacheableSet(txn, 0); - TSHttpTxnServerRespNoStore(txn); + TSHttpTxnServerRespNoStoreSet(txn,1); } TSHandleMLocRelease(buf, TS_NULL_MLOC, loc); TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/146ce519/proxy/InkAPI.cc ---------------------------------------------------------------------- diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc index 10badab..412453a 100644 --- a/proxy/InkAPI.cc +++ b/proxy/InkAPI.cc @@ -5100,12 +5100,12 @@ TSHttpTxnCacheLookupSkip(TSHttpTxn txnp) } TSReturnCode -TSHttpTxnServerRespNoStore(TSHttpTxn txnp) +TSHttpTxnServerRespNoStoreSet(TSHttpTxn txnp, int flag) { sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS); HttpTransact::State *s = &(((HttpSM *) txnp)->t_state); - s->api_server_response_no_store = true; + s->api_server_response_no_store = (flag != 0); return TS_SUCCESS; } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/146ce519/proxy/api/ts/experimental.h ---------------------------------------------------------------------- diff --git a/proxy/api/ts/experimental.h b/proxy/api/ts/experimental.h index 7263bce..a96ed19 100644 --- a/proxy/api/ts/experimental.h +++ b/proxy/api/ts/experimental.h @@ -182,7 +182,6 @@ extern "C" tsapi TSReturnCode TSHttpTxnSecondUrlTryLock(TSHttpTxn txnp); tsapi TSReturnCode TSHttpTxnRedirectRequest(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc url_loc); tsapi TSReturnCode TSHttpTxnCacheLookupSkip(TSHttpTxn txnp); - tsapi TSReturnCode TSHttpTxnServerRespNoStore(TSHttpTxn txnp); tsapi TSReturnCode TSHttpTxnServerRespIgnore(TSHttpTxn txnp); tsapi TSReturnCode TSHttpTxnShutDown(TSHttpTxn txnp, TSEvent event); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/146ce519/proxy/api/ts/ts.h.in ---------------------------------------------------------------------- diff --git a/proxy/api/ts/ts.h.in b/proxy/api/ts/ts.h.in index 45a113b..1cda32e 100644 --- a/proxy/api/ts/ts.h.in +++ b/proxy/api/ts/ts.h.in @@ -2233,6 +2233,22 @@ extern "C" tsapi TSReturnCode TSHttpTxnCachedRespGet(TSHttpTxn txnp, TSMBuffer* bufp, TSMLoc* offset); tsapi void TSHttpTxnRespCacheableSet(TSHttpTxn txnp, int flag); tsapi void TSHttpTxnReqCacheableSet(TSHttpTxn txnp, int flag); + + /** Set flag indicating whether or not to cache the server response for + given TSHttpTxn + + @note This should be done in the HTTP_READ_RESPONSE_HDR_HOOK or earlier. + + @note If TSHttpTxnRespCacheableSet() is not working the way you expect, + this may be the function you should use instead. + + @param txnp The transaction whose server response you do not want to store. + @param flag Set 0 to allow storing and 1 to disable storing. + + @return TS_SUCCESS. + */ + tsapi TSReturnCode TSHttpTxnServerRespNoStoreSet(TSHttpTxn txnp, int flag); + tsapi TSReturnCode TSFetchPageRespGet (TSHttpTxn txnp, TSMBuffer* bufp, TSMLoc* offset); tsapi char* TSFetchRespGet(TSHttpTxn txnp, int* length); tsapi TSReturnCode TSHttpTxnCacheLookupStatusGet(TSHttpTxn txnp, int* lookup_status);
