From 1abbc00118a82611fec5118ad00ab3faf49469ec Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sun, 30 Oct 2011 14:30:04 +0000 Subject: [PATCH] add constants for PROXYREQ_* to the apache2 global, allow r.proxyreq and r.handler to be writable. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1195168 13f79535-47bb-0310-9956-ffa450edef68 --- modules/lua/lua_request.c | 12 ++++++++++++ modules/lua/lua_vmprep.c | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/modules/lua/lua_request.c b/modules/lua/lua_request.c index 44334bc92b..fe031ad804 100644 --- a/modules/lua/lua_request.c +++ b/modules/lua/lua_request.c @@ -481,6 +481,18 @@ static int req_newindex(lua_State *L) return 0; } + if (0 == strcmp("handler", key)) { + const char *value = luaL_checkstring(L, 3); + r->handler = apr_pstrdup(r->pool, value); + return 0; + } + + if (0 == strcmp("proxyreq", key)) { + int value = luaL_checkinteger(L, 3); + r->proxyreq = value; + return 0; + } + if (0 == strcmp("status", key)) { int code = luaL_checkinteger(L, 3); r->status = code; diff --git a/modules/lua/lua_vmprep.c b/modules/lua/lua_vmprep.c index c2c59e1fe6..fb730cfe24 100644 --- a/modules/lua/lua_vmprep.c +++ b/modules/lua/lua_vmprep.c @@ -122,6 +122,18 @@ AP_LUA_DECLARE(void) ap_lua_load_apache2_lmodule(lua_State *L) lua_pushinteger(L, HTTP_MOVED_TEMPORARILY); lua_setfield(L, -2, "HTTP_MOVED_TEMPORARILY"); + lua_pushinteger(L, PROXYREQ_NONE); + lua_setfield(L, -2, "PROXYREQ_NONE"); + + lua_pushinteger(L, PROXYREQ_PROXY); + lua_setfield(L, -2, "PROXYREQ_PROXY"); + + lua_pushinteger(L, PROXYREQ_REVERSE); + lua_setfield(L, -2, "PROXYREQ_REVERSE"); + + lua_pushinteger(L, PROXYREQ_RESPONSE); + lua_setfield(L, -2, "PROXYREQ_RESPONSE"); + /* lua_pushinteger(L, HTTP_CONTINUE); lua_setfield(L, -2, "HTTP_CONTINUE"); -- 2.40.0