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

Function TSPluginInit

example/plugins/c-api/intercept/intercept.cc:543–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541}
542
543void
544TSPluginInit(int /* argc */, const char * /* argv */[])
545{
546 TSPluginRegistrationInfo info;
547
548 info.plugin_name = PLUGIN_NAME;
549 info.vendor_name = "Apache Software Foundation";
550 info.support_email = "dev@trafficserver.apache.org";
551
552 if (TSPluginRegister(&info) != TS_SUCCESS) {
553 VERROR("plugin registration failed\n");
554 }
555
556 // XXX accept hostname and port arguments
557
558 TxnHook = InterceptContCreate(InterceptTxnHook, nullptr, nullptr);
559 InterceptHook = InterceptContCreate(InterceptInterceptHook, nullptr, nullptr);
560
561 // Wait until after the cache lookup to decide whether to
562 // intercept a request. For cache hits, we will never intercept.
563 TSHttpHookAdd(TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK, TxnHook);
564}

Callers

nothing calls this directly

Calls 3

TSPluginRegisterFunction · 0.85
InterceptContCreateFunction · 0.85
TSHttpHookAddFunction · 0.85

Tested by

no test coverage detected