trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [14/50] git commit: Puke when the lua load fails
Date Tue, 12 Jun 2012 15:51:36 GMT
Puke when the lua load fails


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

Branch: refs/heads/jpeach/lua
Commit: 2c6cca07fb5d9fc2ce565d7bdcf59bae2ef69c95
Parents: 9be9617
Author: James Peach <jpeach@apache.org>
Authored: Tue Apr 17 22:17:03 2012 -0700
Committer: James Peach <jpeach@apache.org>
Committed: Tue Jun 12 08:48:37 2012 -0700

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2c6cca07/plugins/lua/lua.cc
----------------------------------------------------------------------
diff --git a/plugins/lua/lua.cc b/plugins/lua/lua.cc
index f308524..74a4631 100644
--- a/plugins/lua/lua.cc
+++ b/plugins/lua/lua.cc
@@ -145,8 +145,10 @@ TSRemapNewInstance(int argc, char * argv[], void ** ih, char * errbuf,
int errbu
       TSDebug("lua", "%s loading lua file %s", __func__, argv[i]);
       if (luaL_dofile(lua, argv[i]) != 0) {
         // If the load failed, it should have pushed an error message.
-        TSError("lua load error: %s", lua_tostring(lua, -1));
+        TSError("error loading %s: %s", argv[i], lua_tostring(lua, -1));
         lua_pop(lua, 1);
+        lua_close(lua);
+        return TS_ERROR;
       }
     }
   }


Mime
View raw message