]> granicus.if.org Git - apache/commitdiff
Merge r1200977 from trunk:
authorJim Jagielski <jim@apache.org>
Fri, 11 Nov 2011 17:38:11 +0000 (17:38 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 11 Nov 2011 17:38:11 +0000 (17:38 +0000)
don't let thread-scope be selected in a server w/o threads

Submitted by: covener
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1200983 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/mod_lua.c

index 0ac434752e1003f0eae5e350d6b17c4d73bf24c3..b27006c377dd5da511588d29d0709872e8b5fd85 100644 (file)
@@ -857,14 +857,23 @@ static const char *register_lua_scope(cmd_parms *cmd,
         cfg->vm_scope = AP_LUA_SCOPE_CONN;
     }
     else if (strcmp("thread", scope) == 0) {
+#if !APR_HAS_THREADS
+        return apr_psprintf(cmd->pool,
+                            "Scope type of '%s' cannot be used because this "
+                            "server does not have threading support "
+                            "(APR_HAS_THREADS)" 
+                            scope);
+#endif
         cfg->vm_scope = AP_LUA_SCOPE_THREAD;
     }
     else {
         return apr_psprintf(cmd->pool,
                             "Invalid value for LuaScope, '%s', acceptable "
-                            "values are 'once', 'request', 'conn', and "
-                            "'server'",
-                            scope);
+                            "values are: 'once', 'request', 'conn', 'server'"
+#if APR_HAS_THREADS
+                            ", 'thread'"
+#endif
+                            ,scope);
     }
     return NULL;
 }