httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r651859 - in /httpd/mod_wombat/trunk: ./ config.c config.h mod_wombat.c test/test.lua
Date Sat, 26 Apr 2008 20:50:43 GMT
Author: brianm
Date: Sat Apr 26 13:50:40 2008
New Revision: 651859

URL: http://svn.apache.org/viewvc?rev=651859&view=rev
Log:
Remove LuaConfig directive, its supporting code, and tests which rely on it

Modified:
    httpd/mod_wombat/trunk/   (props changed)
    httpd/mod_wombat/trunk/config.c
    httpd/mod_wombat/trunk/config.h
    httpd/mod_wombat/trunk/mod_wombat.c
    httpd/mod_wombat/trunk/test/test.lua

Propchange: httpd/mod_wombat/trunk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Apr 26 13:50:40 2008
@@ -11,3 +11,7 @@
 ref
 mod_wombat_config.h.in
 mod_wombat_config.h
+httpd.conf
+svn-commit.tmp*
+autom4te.cache
+

Modified: httpd/mod_wombat/trunk/config.c
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/trunk/config.c?rev=651859&r1=651858&r2=651859&view=diff
==============================================================================
--- httpd/mod_wombat/trunk/config.c (original)
+++ httpd/mod_wombat/trunk/config.c Sat Apr 26 13:50:40 2008
@@ -18,19 +18,6 @@
 #include "config.h"
 #include "vmprep.h"
 
-static void push_dir_config(lua_State* L, apw_dir_cfg* cfg) {
-    lua_boxpointer(L, cfg);
-    luaL_getmetatable(L, "Apache2.DirConfig");
-    lua_setmetatable(L, -2);
-}
-
-static void apw_push_cmd_parms(lua_State *L, cmd_parms *cmd) {
-    lua_boxpointer(L, cmd);
-    luaL_getmetatable(L, "Apache2.CommandParameters");
-    lua_setmetatable(L, -2);
-    
-}
-
 static apw_dir_cfg* check_dir_config(lua_State* L, int index) {
     luaL_checkudata(L, index, "Apache2.DirConfig");
     apw_dir_cfg *cfg = (apw_dir_cfg*)lua_unboxpointer(L, index);
@@ -207,34 +194,4 @@
     lua_setfield(L, -2, "__index"); 
     luaL_register(L, NULL, cmd_methods); // [metatable]
     
-}
-
-const char* apw_config_via_lua(cmd_parms *cmd, apw_dir_cfg *dir, const char *file, 
-                                                                const char *function) {
-    // do stuff here
-    // ap_log_error(APLOG_MARK, APLOG_ERR, 0, cmd->server, "log me!");
-    
-    apw_vm_spec spec;
-    spec.file = file;
-    spec.scope = APW_SCOPE_ONCE;
-    // pool is required for APW_SCOPE_ONCE
-    spec.pool = cmd->temp_pool;
-    spec.code_cache_style = APW_CODE_CACHE_NEVER;
-    
-    lua_State *L;
-    if (!(L = apw_sgetvm(cmd->server, &spec))) {
-        return "Unable to configure Lua VM, please see logs for details";        
-    }
-
-    lua_getglobal(L, function);
-    apw_push_cmd_parms(L, cmd);
-    push_dir_config(L, dir);
-    if (lua_pcall(L, 2, 0, 0)) {
-        return apr_psprintf(cmd->temp_pool, "Unable to evauate LuaConfig directive: '%s'",

-                            luaL_checkstring(L, -1));
-    }
-
-    // ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, cmd->server, "harder %i", (int) L);
-    
-    return NULL;                                                                      
-}
+}
\ No newline at end of file

Modified: httpd/mod_wombat/trunk/config.h
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/trunk/config.h?rev=651859&r1=651858&r2=651859&view=diff
==============================================================================
--- httpd/mod_wombat/trunk/config.h (original)
+++ httpd/mod_wombat/trunk/config.h Sat Apr 26 13:50:40 2008
@@ -19,9 +19,6 @@
 
 #ifndef APW_CONFIG_H
 #define APW_CONFIG_H
-
-APR_DECLARE(const char*) apw_config_via_lua(cmd_parms *cmd, apw_dir_cfg *_cfg, 
-                                            const char *file, const char *function);
                  
 APR_DECLARE(void) apw_load_config_lmodule(lua_State *L);                                
                                
 

Modified: httpd/mod_wombat/trunk/mod_wombat.c
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/trunk/mod_wombat.c?rev=651859&r1=651858&r2=651859&view=diff
==============================================================================
--- httpd/mod_wombat/trunk/mod_wombat.c (original)
+++ httpd/mod_wombat/trunk/mod_wombat.c Sat Apr 26 13:50:40 2008
@@ -377,11 +377,6 @@
     return NULL;
 }
 
-static const char* register_lua_config(cmd_parms *cmd, void *_cfg, const char *file, const
char *function) {
-    apw_dir_cfg* cfg = (apw_dir_cfg*)_cfg;
-    return apw_config_via_lua(cmd, cfg, file, function);
-}
-
 static const char* register_lua_root(cmd_parms *cmd, void *_cfg, const char *root) {
     // apw_dir_cfg* cfg = (apw_dir_cfg*)_cfg;
     apw_server_cfg* cfg = ap_get_module_config(cmd->server->module_config, &wombat_module);
@@ -393,9 +388,6 @@
 /*******************************/
 
 command_rec wombat_commands[] = {
-    
-    AP_INIT_TAKE2("LuaConfig", register_lua_config, NULL, OR_ALL, 
-                  "Perform in-Lua Configuration"),
 
     AP_INIT_TAKE1("LuaRoot", register_lua_root, NULL, OR_ALL, 
                 "Specify the base path for resolving relative paths for mod_wombat directives"),
@@ -422,23 +414,23 @@
     
     // todo: test
     AP_INIT_TAKE2("LuaHookCheckUserID", register_check_user_id_hook, NULL, OR_ALL, 
-                "Provide a hook for the check_user_id phase of request processing"),    
+                  "Provide a hook for the check_user_id phase of request processing"),  
 
     
     // todo: test
     AP_INIT_TAKE2("LuaHookTypeChecker", register_type_checker_hook, NULL, OR_ALL, 
-                "Provide a hook for the type_checker phase of request processing"),
+                  "Provide a hook for the type_checker phase of request processing"),
     
     // todo: test
     AP_INIT_TAKE2("LuaHookAccessChecker", register_access_checker_hook, NULL, OR_ALL, 
-                "Provide a hook for the access_checker phase of request processing"),
+                  "Provide a hook for the access_checker phase of request processing"),
     
     // todo: test
     AP_INIT_TAKE2("LuaHookAuthChecker", register_auth_checker_hook, NULL, OR_ALL, 
-                "Provide a hook for the auth_checker phase of request processing"),
+                  "Provide a hook for the auth_checker phase of request processing"),
     
     // todo: test
     AP_INIT_TAKE2("LuaHookInsertFilter", register_insert_filter_hook, NULL, OR_ALL, 
-                "Provide a hook for the insert_filter phase of request processing"),
+                  "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. \

Modified: httpd/mod_wombat/trunk/test/test.lua
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/trunk/test/test.lua?rev=651859&r1=651858&r2=651859&view=diff
==============================================================================
--- httpd/mod_wombat/trunk/test/test.lua (original)
+++ httpd/mod_wombat/trunk/test/test.lua Sat Apr 26 13:50:40 2008
@@ -116,28 +116,4 @@
     assert(r:find("Hi"), "Didn't find 'Hi'")
 end
 
-function test:simple_mapped()
-    local r, c = http.get "/simple"
-    assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
-    assert(r:find("Hi"), "Didn't find 'Hi'")
-end
-
-function test:super_basic_config() 
-    local r, c = http.get "/super-basic-config"
-    assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
-    assert(r:find("success in handle"), "Didn't find 'success in handle'")
-end
-
-function test:server_says_hi()
-    local r, c = http.get "/server-says-hi"
-    assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
-    assert(r:find("hello from server scope"), "Didn't find expected text in response")  
 
-end
-
-function test:request_scope_says_hi()
-    local r, c = http.get "/request-says-hi"
-    assert(200 == c, "incorrect status code returned, expected 200 got " .. c)
-    assert(r:find("hello from request scope"), "Didn't find expected text in response")
-end
-
 test:run()



Mime
View raw message