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 7707710B0D for ; Mon, 10 Jun 2013 14:37:19 +0000 (UTC) Received: (qmail 80156 invoked by uid 500); 10 Jun 2013 14:37:19 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 80085 invoked by uid 500); 10 Jun 2013 14:37:19 -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 80078 invoked by uid 99); 10 Jun 2013 14:37:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jun 2013 14:37:18 +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; Mon, 10 Jun 2013 14:37:17 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2309823889BB; Mon, 10 Jun 2013 14:36:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1491468 [2/2] - in /httpd/httpd/branches/2.4.x: ./ docs/manual/mod/ modules/lua/ Date: Mon, 10 Jun 2013 14:36:57 -0000 To: cvs@httpd.apache.org From: minfrin@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130610143658.2309823889BB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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=1491468&r1=1491467&r2=1491468&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 Mon Jun 10 14:36:56 2013 @@ -23,6 +23,18 @@ APLOG_USE_MODULE(lua); +#ifndef AP_LUA_MODULE_EXT +#if defined(NETWARE) +#define AP_LUA_MODULE_EXT ".nlm" +#elif defined(WIN32) +#define AP_LUA_MODULE_EXT ".dll" +#elif (defined(__hpux__) || defined(__hpux)) && !defined(__ia64) +#define AP_LUA_MODULE_EXT ".sl" +#else +#define AP_LUA_MODULE_EXT ".so" +#endif +#endif + #if APR_HAS_THREADS apr_thread_mutex_t *ap_lua_mutex; @@ -108,7 +120,7 @@ static void pstack_dump(lua_State *L, ap #define makeintegerfield(L, n) lua_pushinteger(L, n); lua_setfield(L, -2, #n) -AP_LUA_DECLARE(void) ap_lua_load_apache2_lmodule(lua_State *L) +void ap_lua_load_apache2_lmodule(lua_State *L) { lua_getglobal(L, "package"); lua_getfield(L, -1, "loaded"); @@ -314,8 +326,11 @@ static apr_status_t vm_construct(lua_Sta spec->file); } if (spec->package_cpaths) { - munge_path(L, "cpath", "?.so", "./?.so", lifecycle_pool, - spec->package_cpaths, spec->file); + munge_path(L, + "cpath", "?" AP_LUA_MODULE_EXT, "./?" AP_LUA_MODULE_EXT, + lifecycle_pool, + spec->package_cpaths, + spec->file); } if (spec->cb) { @@ -390,7 +405,7 @@ static apr_status_t server_vm_construct( * Function used to create a lua_State instance bound into the web * server in the appropriate scope. */ -AP_LUA_DECLARE(lua_State*)ap_lua_get_lua_state(apr_pool_t *lifecycle_pool, +lua_State *ap_lua_get_lua_state(apr_pool_t *lifecycle_pool, ap_lua_vm_spec *spec, request_rec* r) { lua_State *L = NULL; Modified: httpd/httpd/branches/2.4.x/modules/lua/lua_vmprep.h URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/lua/lua_vmprep.h?rev=1491468&r1=1491467&r2=1491468&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/lua/lua_vmprep.h (original) +++ httpd/httpd/branches/2.4.x/modules/lua/lua_vmprep.h Mon Jun 10 14:36:56 2013 @@ -107,7 +107,7 @@ typedef struct typedef struct { apr_size_t runs; apr_time_t modified; - apr_size_t size; + apr_off_t size; } ap_lua_finfo; typedef struct { @@ -115,16 +115,10 @@ typedef struct { ap_lua_finfo* finfo; } ap_lua_server_spec; -/* remove and make static once out of mod_wombat.c */ -AP_LUA_DECLARE(void) ap_lua_openlibs(lua_State *L); - -/* remove and make static once out of mod_wombat.c */ -AP_LUA_DECLARE(void) ap_lua_registerlib(lua_State *L, char *name, lua_CFunction f); - /** * Fake out addition of the "apache2" module */ -AP_LUA_DECLARE(void) ap_lua_load_apache2_lmodule(lua_State *L); +void ap_lua_load_apache2_lmodule(lua_State *L); /* * alternate means of getting lua_State (preferred eventually) @@ -138,7 +132,7 @@ AP_LUA_DECLARE(void) ap_lua_load_apache2 * @cb callback for vm initialization called *before* the file is opened * @ctx a baton passed to cb */ -AP_LUA_DECLARE(lua_State*) ap_lua_get_lua_state(apr_pool_t *lifecycle_pool, +lua_State *ap_lua_get_lua_state(apr_pool_t *lifecycle_pool, ap_lua_vm_spec *spec, request_rec* r); #if APR_HAS_THREADS || defined(DOXYGEN) Modified: httpd/httpd/branches/2.4.x/modules/lua/mod_lua.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/lua/mod_lua.c?rev=1491468&r1=1491467&r2=1491468&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/lua/mod_lua.c (original) +++ httpd/httpd/branches/2.4.x/modules/lua/mod_lua.c Mon Jun 10 14:36:56 2013 @@ -19,6 +19,7 @@ #include #include #include +#include #include "lua_apr.h" #include "lua_config.h" @@ -63,6 +64,7 @@ typedef struct int broken; } lua_filter_ctx; +apr_thread_mutex_t* lua_ivm_mutex = NULL; /** * error reporting if lua has an error. @@ -748,11 +750,17 @@ static int lua_map_handler(request_rec * if (lua_isnumber(L, -1)) { rc = lua_tointeger(L, -1); } + else { + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(02483) + "lua: Lua handler %s in %s did not return a value, assuming apache2.OK", + function_name, + filename); + rc = OK; + } + ap_lua_release_state(L, spec, r); if (rc != DECLINED) { - ap_lua_release_state(L, spec, r); return rc; } - ap_lua_release_state(L, spec, r); } } return DECLINED; @@ -1552,7 +1560,9 @@ static const char *register_lua_root(cmd cfg->root_path = root; return NULL; } -AP_LUA_DECLARE(const char *) ap_lua_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var) + +const char *ap_lua_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, + request_rec *r, const char *var) { if (lua_ssl_val) { return (const char *)lua_ssl_val(p, s, c, r, (char *)var); @@ -1560,7 +1570,7 @@ AP_LUA_DECLARE(const char *) ap_lua_ssl_ return NULL; } -AP_LUA_DECLARE(int) ap_lua_ssl_is_https(conn_rec *c) +int ap_lua_ssl_is_https(conn_rec *c) { return lua_ssl_is_https ? lua_ssl_is_https(c) : 0; } @@ -1970,6 +1980,9 @@ static void lua_register_hooks(apr_pool_ #endif /* providers */ lua_authz_providers = apr_hash_make(p); + + /* ivm mutex */ + apr_thread_mutex_create(&lua_ivm_mutex, APR_THREAD_MUTEX_DEFAULT, p); } AP_DECLARE_MODULE(lua) = { Modified: httpd/httpd/branches/2.4.x/modules/lua/mod_lua.dsp URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/lua/mod_lua.dsp?rev=1491468&r1=1491467&r2=1491468&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/lua/mod_lua.dsp (original) +++ httpd/httpd/branches/2.4.x/modules/lua/mod_lua.dsp Mon Jun 10 14:36:56 2013 @@ -117,6 +117,14 @@ SOURCE=.\lua_config.h # End Source File # Begin Source File +SOURCE=.\lua_passwd.c +# End Source File +# Begin Source File + +SOURCE=.\lua_passwd.h +# End Source File +# Begin Source File + SOURCE=.\lua_request.c # End Source File # Begin Source File Modified: httpd/httpd/branches/2.4.x/modules/lua/mod_lua.h URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/lua/mod_lua.h?rev=1491468&r1=1491467&r2=1491468&view=diff ============================================================================== --- httpd/httpd/branches/2.4.x/modules/lua/mod_lua.h (original) +++ httpd/httpd/branches/2.4.x/modules/lua/mod_lua.h Mon Jun 10 14:36:56 2013 @@ -168,8 +168,9 @@ APR_DECLARE_EXTERNAL_HOOK(ap_lua, AP_LUA APR_DECLARE_EXTERNAL_HOOK(ap_lua, AP_LUA, int, lua_request, (lua_State *L, request_rec *r)) -AP_LUA_DECLARE(const char *) ap_lua_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var); +const char *ap_lua_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, + request_rec *r, const char *var); -AP_LUA_DECLARE(int) ap_lua_ssl_is_https(conn_rec *c); +int ap_lua_ssl_is_https(conn_rec *c); #endif /* !_MOD_LUA_H_ */