httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1367040 - in /httpd/httpd/trunk/modules/lua: lua_vmprep.c lua_vmprep.h mod_lua.c
Date Mon, 30 Jul 2012 09:06:42 GMT
Author: humbedooh
Date: Mon Jul 30 09:06:41 2012
New Revision: 1367040

URL: http://svn.apache.org/viewvc?rev=1367040&view=rev
Log:
mod_lua: Pass on the request_rec to ap_lua_get_lua_state, so we can use it for allocating
memory for the cache info lookup.

Modified:
    httpd/httpd/trunk/modules/lua/lua_vmprep.c
    httpd/httpd/trunk/modules/lua/lua_vmprep.h
    httpd/httpd/trunk/modules/lua/mod_lua.c

Modified: httpd/httpd/trunk/modules/lua/lua_vmprep.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_vmprep.c?rev=1367040&r1=1367039&r2=1367040&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_vmprep.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_vmprep.c Mon Jul 30 09:06:41 2012
@@ -338,7 +338,7 @@ static apr_status_t vm_construct(lua_Sta
  * server in the appropriate scope.
  */
 AP_LUA_DECLARE(lua_State*)ap_lua_get_lua_state(apr_pool_t *lifecycle_pool,
-                                               ap_lua_vm_spec *spec)
+                                               ap_lua_vm_spec *spec, request_rec* r)
 {
     lua_State *L = NULL;
     int tryCache = 0;
@@ -365,7 +365,7 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua
     }
     else {
         ap_lua_finfo *cache_info;
-        char* mkey = apr_psprintf(lifecycle_pool, "ap_lua_modified:%s", spec->file); /*
XXX: Change to a different pool? */
+        char* mkey = apr_psprintf(r->pool, "ap_lua_modified:%s", spec->file);
         if (apr_pool_userdata_get((void **)&cache_info, mkey,
                               lifecycle_pool) == APR_SUCCESS) {
             if (cache_info == NULL) {

Modified: httpd/httpd/trunk/modules/lua/lua_vmprep.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_vmprep.h?rev=1367040&r1=1367039&r2=1367040&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_vmprep.h (original)
+++ httpd/httpd/trunk/modules/lua/lua_vmprep.h Mon Jul 30 09:06:41 2012
@@ -121,7 +121,7 @@ AP_LUA_DECLARE(void) ap_lua_load_apache2
  * @ctx a baton passed to cb
  */
 AP_LUA_DECLARE(lua_State*) ap_lua_get_lua_state(apr_pool_t *lifecycle_pool,
-                                                ap_lua_vm_spec *spec);
+                                                ap_lua_vm_spec *spec, request_rec* r);
 
 
 

Modified: httpd/httpd/trunk/modules/lua/mod_lua.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/mod_lua.c?rev=1367040&r1=1367039&r2=1367040&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/mod_lua.c (original)
+++ httpd/httpd/trunk/modules/lua/mod_lua.c Mon Jul 30 09:06:41 2012
@@ -191,7 +191,7 @@ static int lua_handler(request_rec *r)
         ap_lua_vm_spec *spec = create_vm_spec(&pool, r, cfg, NULL, NULL, NULL,
                                               0, "handle", "request handler");
 
-        L = ap_lua_get_lua_state(pool, spec);
+        L = ap_lua_get_lua_state(pool, spec, r);
         if (!L) {
             /* TODO annotate spec with failure reason */
             r->status = HTTP_INTERNAL_SERVER_ERROR;
@@ -250,7 +250,7 @@ static int lua_request_rec_hook_harness(
                                   hook_spec->function_name,
                                   "request hook");
 
-            L = ap_lua_get_lua_state(pool, spec);
+            L = ap_lua_get_lua_state(pool, spec, r);
 
             if (!L) {
                 ap_log_rerror(APLOG_MARK, APLOG_CRIT, 0, r, APLOGNO(01477)
@@ -1042,7 +1042,7 @@ static authz_status lua_authz_check(requ
     spec = create_vm_spec(&pool, r, cfg, server_cfg, prov_spec->file_name,
                           NULL, 0, prov_spec->function_name, "authz provider");
 
-    L = ap_lua_get_lua_state(pool, spec);
+    L = ap_lua_get_lua_state(pool, spec, r);
     if (L == NULL) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02314)
                       "Unable to compile VM for authz provider %s", prov_spec->name);



Mime
View raw message