TSHttpTxnIsInternal

Test whether a request is internally-generated.

Synopsis

  1. #include <ts/ts.h>

int TSHttpTxnIsInternal(TSHttpTxn txnp)

int TSHttpSsnIsInternal(TSHttpSsn ssnp)

Description

TSHttpTxnIsInternal() tests whether a HTTP transaction was originated within Traffic Server.

TSHttpSsnIsInternal() tests whether a HTTP session was originated within Traffic Server.

Return Values

Both these APIs return a int, indicating whether the request was internal (1) or not (0).

Examples

The ESI plugin uses TSHttpTxnIsInternal() to ignore requests that is had generated while fetching portions of an ESI document:

  1. cacheable = true;
  2. if (Utils::areEqual(name, name_len, TS_MIME_FIELD_EXPIRES, TS_MIME_LEN_EXPIRES)) {
  3. if ((value_len == 1) && (*value == '0')) {
  4. cacheable = false;

See also

TSAPI(3ts)