The plugins are loaded and initialized within Main.cc by calling plugin_init() one by one.
The global hooks list is initialized before any http port / service is ready to serve. There is no thread issue because all the threads are blocked for incoming events. - oknet Walt Karas <wka...@oath.com.invalid> 于2018年12月13日周四 上午9:20写道: > > I don't understand your and answer Leif. You can't possibly call those > function from TSPluginInit() or TSRemapInit(). > > On Wed, Dec 12, 2018 at 7:01 PM Leif Hedstrom <zw...@apache.org> wrote: > > > > > > > > On Dec 12, 2018, at 4:54 PM, Walt Karas <wka...@oath.com.INVALID> wrote: > > > > > > The documentation says that TS API functionTSHttpHookAdd() is _typically_ > > > called from TSPluginInit() or TSRemapInit(). The implementation of > > > TSHttpHookAdd() doesn't look thread-safe, so how could it be called > > > anywhere else? > > > > > > I don’t think you would. For TXN or SSN continuations, you use > > > > tsapi void TSHttpSsnHookAdd(TSHttpSsn ssnp, TSHttpHookID id, > > TSCont contp); > > tsapi void TSHttpTxnHookAdd(TSHttpTxn txnp, TSHttpHookID id, > > TSCont contp); > > > > > > — Leif > > > > -- - Oknet Xu