Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 019559646 for ; Tue, 7 Aug 2012 17:30:16 +0000 (UTC) Received: (qmail 55079 invoked by uid 500); 7 Aug 2012 17:30:15 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 55015 invoked by uid 500); 7 Aug 2012 17:30:15 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 55008 invoked by uid 99); 7 Aug 2012 17:30:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2012 17:30:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2012 17:30:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6AE2723888FD; Tue, 7 Aug 2012 17:29:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1370377 - in /httpd/httpd/trunk: CHANGES modules/lua/mod_lua.c Date: Tue, 07 Aug 2012 17:29:27 -0000 To: cvs@httpd.apache.org From: humbedooh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120807172927.6AE2723888FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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);