Skip to content

Commit 6984458

Browse files
committed
add check to transaction status, if more than 299 then bypass the slice plugin intercept
1 parent 4bdde5d commit 6984458

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plugins/experimental/slice/slice.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ read_request(TSHttpTxn txnp, Config *const config)
4343
if (TS_HTTP_METHOD_GET == header.method()) {
4444
static int const SLICER_MIME_LEN_INFO = strlen(SLICER_MIME_FIELD_INFO);
4545
if (!header.hasKey(SLICER_MIME_FIELD_INFO, SLICER_MIME_LEN_INFO)) {
46+
// check if any previous plugin has monkeyed with the transaction status
47+
TSHttpStatus const txnstat = TSHttpTxnStatusGet(txnp);
48+
if (299 < (int)txnstat) {
49+
DEBUG_LOG("slice: txn status change detected, skipping plugin: %d\n", (int)txnstat);
50+
return false;
51+
}
52+
4653
// turn off any and all transaction caching (shouldn't matter)
4754
TSHttpTxnServerRespNoStoreSet(txnp, 1);
4855
TSHttpTxnRespCacheableSet(txnp, 0);

0 commit comments

Comments
 (0)