You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/06/12 17:51:37 UTC

[29/50] git commit: Export remap constants

Export remap constants


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/143fcd45
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/143fcd45
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/143fcd45

Branch: refs/heads/jpeach/lua
Commit: 143fcd45afe19074d7b812f5dad72902a2bd1f36
Parents: f6bc13b
Author: James Peach <jp...@apache.org>
Authored: Mon Apr 9 21:29:56 2012 -0700
Committer: James Peach <jp...@apache.org>
Committed: Tue Jun 12 08:48:34 2012 -0700

----------------------------------------------------------------------
 plugins/lua/lua.cc |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/143fcd45/plugins/lua/lua.cc
----------------------------------------------------------------------
diff --git a/plugins/lua/lua.cc b/plugins/lua/lua.cc
index 2e9d536..54ec3e7 100644
--- a/plugins/lua/lua.cc
+++ b/plugins/lua/lua.cc
@@ -80,8 +80,24 @@ TSRemapNewInstance(int argc, char * argv[], void ** ih, char * errbuf, int errbu
   }
 
   luaL_openlibs(lua);
+
+  // Register functions in the "ts" module.
   luaL_register(lua, "ts", LUAEXPORTS);
 
+  // Get the "ts" module table back on the stack.
+  lua_getglobal(lua, "ts");
+  TSReleaseAssert(lua_istable(lua, -1));
+
+  // Push constants into the "ts" module.
+  lua_pushinteger(lua, TSREMAP_DID_REMAP);
+  lua_setfield(lua, -2, "REMAP_COMPLETE");
+
+  lua_pushinteger(lua, TSREMAP_DID_REMAP);
+  lua_setfield(lua, -2, "REMAP_CONTINUE");
+
+  // Pop the "ts" module table.
+  lua_pop(lua, 1);
+
   for (int i = 0; i < argc; ++i) {
     if (access(argv[i], R_OK) == 0) {
       TSDebug("lua", "%s loading lua file %s", __func__, argv[i]);