httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r1200513 - in /httpd/httpd/trunk/modules/lua: lua_vmprep.c mod_lua.c mod_lua.h
Date Thu, 10 Nov 2011 20:02:07 GMT
Author: brianm
Date: Thu Nov 10 20:02:07 2011
New Revision: 1200513

URL: http://svn.apache.org/viewvc?rev=1200513&view=rev
Log:
remove last traces of the code cache

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

Modified: httpd/httpd/trunk/modules/lua/lua_vmprep.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_vmprep.c?rev=1200513&r1=1200512&r2=1200513&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_vmprep.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_vmprep.c Thu Nov 10 20:02:07 2011
@@ -282,18 +282,22 @@ static void munge_path(lua_State *L,
     current = lua_tostring(L, -1);
 
     parent_dir = ap_make_dirstr_parent(pool, file);
+ 
+    ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, NULL, "parent_dir %s", parent_dir);
+
     pattern = apr_pstrcat(pool, parent_dir, sub_pat, NULL);
+    ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, NULL, "pattern %s", pattern);
     luaL_gsub(L, current, rep_pat, pattern);
     lua_setfield(L, -3, field);
     lua_getfield(L, -2, field);
     modified = lua_tostring(L, -1);
-
+    ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, NULL, "modified %s", modified);
 
     lua_pop(L, 2);
 
     part = apr_pstrcat(pool, modified, ";", apr_array_pstrcat(pool, paths, ';'),
                        NULL);
-
+    ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, NULL, "part %s", part);
     lua_pushstring(L, part);
     lua_setfield(L, -2, field);
     lua_pop(L, 1);              /* pop "package" off the stack     */
@@ -438,8 +442,10 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua
                                       spec->pool) != APR_SUCCESS)
                     return NULL;
 
-                apr_pool_userdata_set(reslist, "mod_lua",
-                                      vm_reslist_destroy, spec->pool);
+                apr_pool_userdata_set(reslist, 
+                                      "mod_lua",
+                                      vm_reslist_destroy, 
+                                      spec->pool);
             }
             apr_reslist_acquire(reslist, (void **)&L);
             lua_pushlightuserdata(L, L);

Modified: httpd/httpd/trunk/modules/lua/mod_lua.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/mod_lua.c?rev=1200513&r1=1200512&r2=1200513&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/mod_lua.c (original)
+++ httpd/httpd/trunk/modules/lua/mod_lua.c Thu Nov 10 20:02:07 2011
@@ -129,7 +129,6 @@ static int lua_handler(request_rec *r)
             spec->scope = dcfg->vm_scope;
             spec->pool = spec->scope==APL_SCOPE_SERVER ? cfg->pool : r->pool;
             spec->file = r->filename;
-            spec->code_cache_style = dcfg->code_cache_style;
             spec->package_paths = cfg->package_paths;
             spec->package_cpaths = cfg->package_cpaths;
             spec->vm_server_pool_min = cfg->vm_server_pool_min;
@@ -141,9 +140,8 @@ static int lua_handler(request_rec *r)
         }
 
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
-                      "request details scope:%u, cache:%u, filename:%s, function:%s",
+                      "request details scope:%u, filename:%s, function:%s",
                       d->spec->scope,
-                      d->spec->code_cache_style,
                       d->spec->file,
                       d->function_name);
         L = ap_lua_get_lua_state(r->pool,
@@ -200,7 +198,6 @@ static int lua_alias_munger(request_rec 
             spec->file = ap_pregsub(r->pool, cnd->file_name, r->uri,
                                     AP_MAX_REG_MATCH, matches);
             spec->scope = cnd->scope;
-            spec->code_cache_style = cnd->code_cache_style;
             spec->bytecode = cnd->bytecode;
             spec->bytecode_len = cnd->bytecode_len;
             if (spec->scope == APL_SCOPE_ONCE) {
@@ -253,7 +250,6 @@ static int lua_request_rec_hook_harness(
             spec = apr_pcalloc(r->pool, sizeof(ap_lua_vm_spec));
 
             spec->file = hook_spec->file_name;
-            spec->code_cache_style = hook_spec->code_cache_style;
             spec->scope = hook_spec->scope;
             spec->vm_server_pool_min = cfg->vm_server_pool_min;
             spec->vm_server_pool_max = cfg->vm_server_pool_max;
@@ -502,7 +498,6 @@ static const char *register_named_block_
         else {
             function = NULL;
         }
-        spec->code_cache_style = APL_CODE_CACHE_FOREVER;
 
         ctx.cmd = cmd;
         tmp = apr_pstrdup(cmd->pool, cmd->err_directive->directive + 1);
@@ -580,20 +575,13 @@ static const char *register_named_file_f
     spec->file_name = apr_pstrdup(cmd->pool, file);
     spec->function_name = apr_pstrdup(cmd->pool, function);
     spec->scope = cfg->vm_scope;
-    spec->code_cache_style = APL_CODE_CACHE_STAT;
-    /*
-       int code_cache_style;
-       char *function_name;
-       char *file_name;
-       int scope;
-     */
+
     *(ap_lua_mapped_handler_spec **) apr_array_push(hook_specs) = spec;
     return NULL;
 }
 
 static int lua_check_user_id_harness_first(request_rec *r)
 {
-
     return lua_request_rec_hook_harness(r, "check_user_id", AP_LUA_HOOK_FIRST);
 }
 static int lua_check_user_id_harness(request_rec *r)
@@ -905,7 +893,8 @@ static const char *register_package_dir(
  * Called for config directive which looks like
  * LuaPackageCPath /lua/package/path/mapped/thing/like/this/?.so
  */
-static const char *register_package_cdir(cmd_parms *cmd, void *_cfg,
+static const char *register_package_cdir(cmd_parms *cmd, 
+                                         void *_cfg,
                                          const char *arg)
 {
     ap_lua_dir_cfg *cfg = (ap_lua_dir_cfg *) _cfg;
@@ -913,35 +902,11 @@ static const char *register_package_cdir
     return register_package_helper(cmd, arg, cfg->package_cpaths);
 }
 
-/**
- * Called for config directive which looks like
- * LuaCodeCache
- */
-static const char *register_code_cache(cmd_parms *cmd, void *_cfg,
-                                       const char *arg)
-{
-    ap_lua_dir_cfg *cfg = (ap_lua_dir_cfg *) _cfg;
-    if (strcmp("stat", arg) == 0) {
-        cfg->code_cache_style = APL_CODE_CACHE_STAT;
-    }
-    else if (strcmp("forever", arg) == 0) {
-        cfg->code_cache_style = APL_CODE_CACHE_FOREVER;
-    }
-    else if (strcmp("never", arg) == 0) {
-        cfg->code_cache_style = APL_CODE_CACHE_NEVER;
-    }
-    else {
-        return apr_psprintf(cmd->pool,
-                            "Invalid value for LuaCodeCache, '%s', "
-                            "acceptable values are 'stat', 'forever', and "
-                            "'never'",
-                            arg);
-    }
-    return NULL;
-}
 
-static const char *register_lua_scope(cmd_parms *cmd, void *_cfg,
-                                      const char *scope, const char *min,
+static const char *register_lua_scope(cmd_parms *cmd, 
+                                      void *_cfg,
+                                      const char *scope, 
+                                      const char *min,
                                       const char *max)
 {
     ap_lua_dir_cfg *cfg = (ap_lua_dir_cfg *) _cfg;
@@ -1090,10 +1055,6 @@ command_rec lua_commands[] = {
                   OR_ALL,
                   "Provide a hook for the insert_filter phase of request processing"),
 
-    AP_INIT_TAKE1("LuaCodeCache", register_code_cache, NULL, OR_ALL,
-                  "Configure the compiled code cache. \
-                   Default is to stat the file each time, options are stat|forever|never"),
-
     AP_INIT_TAKE123("LuaScope", register_lua_scope, NULL, OR_ALL,
                     "One of once, request, conn, server -- default is once"),
 
@@ -1116,7 +1077,6 @@ static void *create_dir_config(apr_pool_
     cfg->package_cpaths = apr_array_make(p, 2, sizeof(char *));
     cfg->mapped_handlers =
         apr_array_make(p, 1, sizeof(ap_lua_mapped_handler_spec *));
-    cfg->code_cache_style = APL_CODE_CACHE_STAT;
     cfg->pool = p;
     cfg->hooks = apr_hash_make(p);
     cfg->dir = apr_pstrdup(p, dir);
@@ -1137,12 +1097,8 @@ static void *create_server_config(apr_po
 {
 
     ap_lua_server_cfg *cfg = apr_pcalloc(p, sizeof(ap_lua_server_cfg));
-    cfg->code_cache = apr_pcalloc(p, sizeof(ap_lua_code_cache));
-    apr_thread_rwlock_create(&cfg->code_cache->compiled_files_lock, p);
-    cfg->code_cache->compiled_files = apr_hash_make(p);
     cfg->vm_reslists = apr_hash_make(p);
     apr_thread_rwlock_create(&cfg->vm_reslists_lock, p);
-    cfg->code_cache->pool = p;
     cfg->root_path = NULL;
 
     return cfg;

Modified: httpd/httpd/trunk/modules/lua/mod_lua.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/mod_lua.h?rev=1200513&r1=1200512&r2=1200513&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/mod_lua.h (original)
+++ httpd/httpd/trunk/modules/lua/mod_lua.h Thu Nov 10 20:02:07 2011
@@ -94,11 +94,6 @@ typedef struct
     apr_pool_t *pool;
 
     /**
-     * CODE_CACHE_STAT | CODE_CACHE_FOREVER | CODE_CACHE_NEVER
-     */
-    unsigned int code_cache_style;
-
-    /**
      * APL_SCOPE_ONCE | APL_SCOPE_REQUEST | APL_SCOPE_CONN | APL_SCOPE_SERVER
      */
     unsigned int vm_scope;



Mime
View raw message