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

Function ts_lua_script_register

plugins/lua/ts_lua_util.cc:256–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void
257ts_lua_script_register(lua_State *L, char *script, ts_lua_instance_conf *conf)
258{
259 TSMgmtInt time;
260
261 Dbg(dbg_ctl, "[%s] registering script [%s]", __FUNCTION__, script);
262
263 // we recorded the script reconfigure_time and its conf pointer in registry
264 if (TS_SUCCESS == TSMgmtIntGet("proxy.process.proxy.reconfigure_time", &time)) {
265 lua_pushliteral(L, "__scriptTime");
266 lua_pushstring(L, script);
267 lua_concat(L, 2);
268 lua_pushnumber(L, time);
269 lua_rawset(L, LUA_REGISTRYINDEX);
270
271 lua_pushliteral(L, "__scriptPtr");
272 lua_pushstring(L, script);
273 lua_concat(L, 2);
274 lua_pushlightuserdata(L, conf);
275 lua_rawset(L, LUA_REGISTRYINDEX);
276 } else {
277 TSError("[ts_lua][%s] failed to get node's reconfigure time while registering script", __FUNCTION__);
278 }
279}
280
281int
282ts_lua_add_module(ts_lua_instance_conf *conf, ts_lua_main_ctx *arr, int n, int argc, char *argv[], char *errbuf, int errbuf_size)

Callers 1

TSRemapNewInstanceFunction · 0.85

Calls 2

TSMgmtIntGetFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected