MCPcopy Create free account
hub / github.com/apache/trafficserver / TSRemapDoRemap

Function TSRemapDoRemap

plugins/origin_server_auth/origin_server_auth.cc:1312–1333  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// This is the main "entry" point for the plugin, called for every request.

Source from the content-addressed store, hash-verified

1310// This is the main "entry" point for the plugin, called for every request.
1311//
1312TSRemapStatus
1313TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo * /* rri */)
1314{
1315 S3Config *s3 = static_cast<S3Config *>(ih);
1316
1317 if (s3) {
1318 TSAssert(s3->valid());
1319 // Now schedule the continuation to update the URL when going to origin.
1320 // Note that in most cases, this is a No-Op, assuming you have reasonable
1321 // cache hit ratio. However, the scheduling is next to free (very cheap).
1322 // Another option would be to use a single global hook, and pass the "s3"
1323 // configs via a TXN argument.
1324 s3->schedule(txnp);
1325 } else {
1326 Dbg(dbg_ctl, "Remap context is invalid");
1327 TSError("[%s] No remap context available, check code / config", PLUGIN_NAME);
1328 TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR);
1329 }
1330
1331 // This plugin actually doesn't do anything with remapping. Ever.
1332 return TSREMAP_NO_REMAP;
1333}

Callers

nothing calls this directly

Calls 4

TSHttpTxnStatusSetFunction · 0.85
TSErrorFunction · 0.50
validMethod · 0.45
scheduleMethod · 0.45

Tested by

no test coverage detected