httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r651876 - in /httpd/mod_wombat/trunk: README docs/basic-configuration.txt mod_wombat.c mod_wombat.h
Date Sun, 27 Apr 2008 02:26:11 GMT
Author: brianm
Date: Sat Apr 26 19:26:07 2008
New Revision: 651876

URL: http://svn.apache.org/viewvc?rev=651876&view=rev
Log:
Fix issue with vm_scope being improperly set (copy and paste for the FAIL)

Modified:
    httpd/mod_wombat/trunk/README
    httpd/mod_wombat/trunk/docs/basic-configuration.txt
    httpd/mod_wombat/trunk/mod_wombat.c
    httpd/mod_wombat/trunk/mod_wombat.h

Modified: httpd/mod_wombat/trunk/README
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/trunk/README?rev=651876&r1=651875&r2=651876&view=diff
==============================================================================
--- httpd/mod_wombat/trunk/README (original)
+++ httpd/mod_wombat/trunk/README Sat Apr 26 19:26:07 2008
@@ -7,9 +7,6 @@
     For now, see docs/building-from-subversion.txt
 
 TODO:
-
-    Move most of the server scoped config into directory config
-
     Change to controlling lifecycle by passing in a pool?
         Need to determine how to handle server scoped then!
 

Modified: httpd/mod_wombat/trunk/docs/basic-configuration.txt
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/trunk/docs/basic-configuration.txt?rev=651876&r1=651875&r2=651876&view=diff
==============================================================================
--- httpd/mod_wombat/trunk/docs/basic-configuration.txt (original)
+++ httpd/mod_wombat/trunk/docs/basic-configuration.txt Sat Apr 26 19:26:07 2008
@@ -17,13 +17,24 @@
         will be resolved relative to the current working directory,
         which may not always work well for a server.
 
-    LuaConfig /path/to/config_file.lua function_name
-        Allows for configuring mod_lua directly in Lua, which is
-        kind of convenient.
+    LuaScope once|request|conn|server [max|min max]
+        Specify the lifecycle scope of the Lua interpreter which will
+        be used by handlers in this "Directory." The default is "once"
         
-        Configuring mod_lua this way actually exposes a much more
-        powerful set of configuration options, and is strongly
-        encouraged.
+        once: use the interpreter once and throw it away.
+        
+        request: use the interpreter to handle anything based on 
+                 the same file within this request, which is also 
+                 request scoped.
+                 
+        conn: Same as request but attached to the connection_rec
+        
+        server: This one is different than others because the
+                server scope is quite long lived, and multiple threads
+                will have the same server_rec. To accommodate this
+                server scoped interpreter are stored in an apr
+                resource list. The min and max arguments are intended
+                to specify the pool size, but are unused at this time.
 
     MapLuaHandler uri-pattern /path/to/lua/script.lua [function-name]
         This directive matches a uri pattern to invoke a specific

Modified: httpd/mod_wombat/trunk/mod_wombat.c
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/trunk/mod_wombat.c?rev=651876&r1=651875&r2=651876&view=diff
==============================================================================
--- httpd/mod_wombat/trunk/mod_wombat.c (original)
+++ httpd/mod_wombat/trunk/mod_wombat.c Sat Apr 26 19:26:07 2008
@@ -103,6 +103,9 @@
             d->spec = spec;
             d->function_name = "handle";
         }
+        // ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "request details scope:%u, cache:%u",
+        //                                               d->spec->scope,
+        //                                               d->spec->code_cache_style);
         spec = d->spec;
         lua_State *L = apw_rgetvm(r, spec);
         if (!L) {
@@ -360,24 +363,28 @@
     return NULL;
 }
 
-static const char* register_lua_scope(cmd_parms *cmd, void *_cfg, const char *arg) {
+static const char* register_lua_scope(cmd_parms *cmd, void *_cfg, const char *scope,
+                                                                  const char *min,
+                                                                  const char *max) {
     apw_dir_cfg* cfg = (apw_dir_cfg*)_cfg;
-    if (apr_strnatcmp("once", arg) == 0) {
+    if (apr_strnatcmp("once", scope) == 0) {
         cfg->vm_scope = APW_SCOPE_ONCE;
     }
-    else if (apr_strnatcmp("request", arg) == 0) {
-        cfg->code_cache_style = APW_SCOPE_REQUEST;
+    else if (apr_strnatcmp("request", scope) == 0) {
+        cfg->vm_scope = APW_SCOPE_REQUEST;
     }
-    else if (apr_strnatcmp("conn", arg) == 0) {
-        cfg->code_cache_style = APW_SCOPE_CONN;
+    else if (apr_strnatcmp("conn", scope) == 0) {
+        cfg->vm_scope = APW_SCOPE_CONN;
     }
-    else if (apr_strnatcmp("server", arg) == 0) {
-        cfg->code_cache_style = APW_SCOPE_SERVER;
+    else if (apr_strnatcmp("server", scope) == 0) {
+        cfg->vm_scope = APW_SCOPE_SERVER;
+        if (min) cfg->vm_server_pool_min = atoi(min);
+        if (max) cfg->vm_server_pool_max = atoi(max);
     }
     else {
         return apr_psprintf(cmd->pool, 
                "Invalid value for LuaScope, '%s', acceptable values are %s", 
-               arg, "'once', 'request', 'conn', and 'server'");
+               scope, "'once', 'request', 'conn', and 'server'");
     }
     return NULL;
 }
@@ -460,7 +467,7 @@
                   "Configure the compiled code cache. \
                    Default is to stat the file each time, options are stat|forever|never"),
                    
-    AP_INIT_TAKE1("LuaScope", register_lua_scope, NULL, OR_ALL,
+    AP_INIT_TAKE123("LuaScope", register_lua_scope, NULL, OR_ALL,
                   "One of once, request, conn, server -- default is once"),
 
     AP_INIT_TAKE2("LuaQuickHandler", register_quick_hook, NULL, OR_ALL, 

Modified: httpd/mod_wombat/trunk/mod_wombat.h
URL: http://svn.apache.org/viewvc/httpd/mod_wombat/trunk/mod_wombat.h?rev=651876&r1=651875&r2=651876&view=diff
==============================================================================
--- httpd/mod_wombat/trunk/mod_wombat.h (original)
+++ httpd/mod_wombat/trunk/mod_wombat.h Sat Apr 26 19:26:07 2008
@@ -83,6 +83,8 @@
      * APW_SCOPE_ONCE | APW_SCOPE_REQUEST | APW_SCOPE_CONN | APW_SCOPE_SERVER
      */
     unsigned int vm_scope;
+    unsigned int vm_server_pool_min;
+    unsigned int vm_server_pool_max;
     
     // info for the hook harnesses 
     apr_hash_t *hooks; // <wombat_hook_info>



Mime
View raw message