From 40510d2d2d6abd3ad395176899baade38d91ce9c Mon Sep 17 00:00:00 2001 From: Brian Olsen Date: Thu, 13 Feb 2020 18:02:19 +0000 Subject: [PATCH] if transaction status nonzero, bypass the slice plugin --- plugins/experimental/slice/slice.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/experimental/slice/slice.cc b/plugins/experimental/slice/slice.cc index 432e119a966..f6d9e6f984c 100644 --- a/plugins/experimental/slice/slice.cc +++ b/plugins/experimental/slice/slice.cc @@ -43,6 +43,13 @@ read_request(TSHttpTxn txnp, Config *const config) if (TS_HTTP_METHOD_GET == header.method()) { static int const SLICER_MIME_LEN_INFO = strlen(SLICER_MIME_FIELD_INFO); if (!header.hasKey(SLICER_MIME_FIELD_INFO, SLICER_MIME_LEN_INFO)) { + // check if any previous plugin has monkeyed with the transaction status + TSHttpStatus const txnstat = TSHttpTxnStatusGet(txnp); + if (0 != (int)txnstat) { + DEBUG_LOG("slice: txn status change detected (%d), skipping plugin\n", (int)txnstat); + return false; + } + // turn off any and all transaction caching (shouldn't matter) TSHttpTxnServerRespNoStoreSet(txnp, 1); TSHttpTxnRespCacheableSet(txnp, 0);