Commit 6a864c59 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Backport of Lua exhancements from trunk, mostly to support 5.3

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1784990 13f79535-47bb-0310-9956-ffa450edef68
parent 5775ca72
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

Changes with Apache 2.4.26

  *) mod_lua: Support for Lua 5.3

  *) mod_proxy_http2: support for ProxyPreserverHost directive. [Stefan Eissing]
  
  *) mod_http2: fix for crash when running out of memory.
+3 −0
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@ XCFLAGS += \
#
XDEFINES	+= \
			-DLUA_COMPAT_ALL \
			-DLUA_COMPAT_5_2 \
			-DLUA_COMPAT_5_1 \
			-DLUA_COMPAT_MODULE \
			$(EOLIST)

#
+4 −33
Original line number Diff line number Diff line
-*- mode:org -*-
* Requirements:
** lua 5.1 ( http://www.lua.org/ )
** Apache HTTPD 2.2 ( http://httpd.apache.org/ ) or Apache HTTPD 2.3
** lua 5.1, 5.2, 5.3 ( http://www.lua.org/ ) or LuaJIT 2.x ( http://www.luajit.org/ )
** Apache HTTPD 2.4 ( http://httpd.apache.org/ ) or higher

* Documentation
  See docs/README
@@ -9,32 +9,6 @@
* Building
  For now, see docs/building-from-subversion.txt

* To Consider
  Allow definition of lua_State instances associated with arbitrary
  pool using the pool's user_data constuct. There would, here, be two
  types, pooled and singleton. On the other hand, singleton would work
  fine for almost all cases -- the exception being a process or server
  pool, and then we could stay singleton anyway and lock around it.

  The current "server scope" behavior could, instead, fall into
  connection scope, for long-lived connections, really we want thread
  scope (which Brian Akins knows how to do). Is there a pool
  associated with a thread? Contention on the pool is a pain in a
  highly concurrent environment.

  Could use apr_thread_data_(get|set) if I can find a way to hook into
  thread destruction. Looks like apr threads let you use the standard
  APR_POOL_DECLARE_ACCESSOR(thread); defined method, just need to look
  up what form that takes. -- apr_thread_pool_get -- just attach to
  that pool.

  Given that, we can associate a hash of lua_State instances with
  arbitrary pools, such as the request pool, thread pool, server pool,
  etc. We then use the file as key into the hash. Users, able to
  specify the handler function, can then make use of the same file
  with different handlers to reuse states.

  

* Task List
** TODO Use r->file to determine file, doing rewriting in translate_name   
@@ -43,13 +17,8 @@
   it is pre-handler, will prolly be on the request_config somewhere,
   but sometimes cannot put there, so... fun
** TODO Mapping in the server_rec
** TODO Connection scoped vms
** TODO Figure out how reentrancy works regarding filter chain stuff. 
   Do we need new "threads"?
** TODO Flesh out apw_*getvm for each flavor we allow
** TODO Rework apw_sgetvm to use the create_vm stuff like apw_rgetvm
** TODO apw_rgetvm needs to handle connection scoped vms     
** TODO provide means to implement authn and authz providers
** TODO: Flatten LuaHook* to LuaHook phase file fn ?
** TODO: document or remove block sections
** TODO: test per-dir behavior of block sections
@@ -78,3 +47,5 @@
** Stefan Fritsch
** Eric Covener
** Daniel Gruno
** Günter Knauf
** Jim Jagielski
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ static int cmd_log_at(lua_State *L, int level)
    lua_getinfo(L, "Sl", &dbg);

    msg = luaL_checkstring(L, 2);
    /* Intentional no APLOGNO */
    ap_log_error(dbg.source, dbg.currentline, APLOG_MODULE_INDEX, level, 0,
                 cmd->server, "%s", msg);
    return 0;
+1 −1
Original line number Diff line number Diff line
@@ -782,7 +782,7 @@ int lua_db_acquire(lua_State *L)
                arguments = lua_tostring(L, 3);
                lua_settop(L, 0);
                
                if (strlen(arguments)) {
                if (*arguments) {
                    rc = apr_dbd_open_ex(dbdhandle->driver, pool, 
                            arguments, &dbdhandle->handle, &error);
                    if (rc == APR_SUCCESS) {
Loading