////////////////////////////////////////////////////////////////////////// This is the main "entry" point for the plugin, called for every request.
| 1310 | // This is the main "entry" point for the plugin, called for every request. |
| 1311 | // |
| 1312 | TSRemapStatus |
| 1313 | TSRemapDoRemap(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 | } |
nothing calls this directly
no test coverage detected