You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2012/04/27 15:07:06 UTC

svn commit: r1331413 - in /httpd/httpd/branches/2.4.x: STATUS modules/lua/lua_vmprep.c

Author: jim
Date: Fri Apr 27 13:07:06 2012
New Revision: 1331413

URL: http://svn.apache.org/viewvc?rev=1331413&view=rev
Log:
Merge r1305586 from trunk:

Be more verbose when logging syntax errors

Submitted by: sf
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/modules/lua/lua_vmprep.c

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1331413&r1=1331412&r2=1331413&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Fri Apr 27 13:07:06 2012
@@ -103,11 +103,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
     2.4 patch: Trunk patch works
     +1: sf, jorton, jim
 
-  * mod_lua: Log better error message if parsing of a script fails (including
-    the line number of a syntax error!).
-    Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1305586
-    2.4 patch: Trunk patch works
-    +1: sf, jorton, jim
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]

Modified: httpd/httpd/branches/2.4.x/modules/lua/lua_vmprep.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/lua/lua_vmprep.c?rev=1331413&r1=1331412&r2=1331413&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/lua/lua_vmprep.c (original)
+++ httpd/httpd/branches/2.4.x/modules/lua/lua_vmprep.c Fri Apr 27 13:07:06 2012
@@ -357,24 +357,10 @@ static apr_status_t vm_construct(void **
             "loading lua file %s", spec->file);
         rc = luaL_loadfile(L, spec->file);
         if (rc != 0) {
-            char *err;
-            switch (rc) {
-                case LUA_ERRSYNTAX:
-                    err = "syntax error";
-                    break;
-                case LUA_ERRMEM:
-                    err = "memory allocation error";
-                    break;
-                case LUA_ERRFILE:
-                    err = "error opening or reading file";
-                    break;
-                default:
-                    err = "unknown error";
-                    break;
-            }
             ap_log_perror(APLOG_MARK, APLOG_ERR, 0, lifecycle_pool, APLOGNO(01482)
-                "Loading lua file %s: %s",
-                spec->file, err);
+                          "Error loading %s: %s", spec->file,
+                          rc == LUA_ERRMEM ? "memory allocation error"
+                                           : lua_tostring(L, 0));
             return APR_EBADF;
         }
         lua_pcall(L, 0, LUA_MULTRET, 0);