httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1370377 - in /httpd/httpd/trunk: CHANGES modules/lua/mod_lua.c
Date Tue, 07 Aug 2012 17:29:27 GMT
Author: humbedooh
Date: Tue Aug  7 17:29:26 2012
New Revision: 1370377

URL: http://svn.apache.org/viewvc?rev=1370377&view=rev
Log:
mod_lua: Decline to serve a request if the script doesn't exist, instead of throwing an internal
server error.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/lua/mod_lua.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1370377&r1=1370376&r2=1370377&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Aug  7 17:29:26 2012
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_lua: Decline handling 'lua-script' if the file doesn't exist,
+     rather than throwing an internal server error. [Daniel Gruno]
+
   *) mod_lua: Add functions r:flush and r:sendfile as well as additional
      request information to the request_rec structure. [Daniel Gruno]
 

Modified: httpd/httpd/trunk/modules/lua/mod_lua.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/mod_lua.c?rev=1370377&r1=1370376&r2=1370377&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/mod_lua.c (original)
+++ httpd/httpd/trunk/modules/lua/mod_lua.c Tue Aug  7 17:29:26 2012
@@ -236,6 +236,14 @@ static int lua_handler(request_rec *r)
     if (strcmp(r->handler, "lua-script")) {
         return DECLINED;
     }
+    /* Decline the request if the script does not exist (or is a directory),
+     * rather than just returning internal server error */
+    if (
+            (r->finfo.filetype == APR_NOFILE)
+            || (r->finfo.filetype & APR_DIR)
+        ) {
+        return DECLINED;
+    }
     ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, APLOGNO(01472)
                   "handling [%s] in mod_lua", r->filename);
 



Mime
View raw message