1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

change syntax for getting document root in mod_lua to r.document_root, suggested by Bertrand Mansion

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@748948 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brian McCallister
2009-03-01 01:37:44 +00:00
parent d68a529544
commit b059de05d2

View File

@@ -211,15 +211,14 @@ static int req_add_output_filter(lua_State *L)
return 0;
}
static int req_document_root(lua_State *L)
{
request_rec *r = apl_check_request_rec(L, 1);
lua_pushstring(L, ap_document_root(r));
return 1;
}
/* BEGIN dispatch mathods for request_rec fields */
/* not really a field, but we treat it like one */
static char *req_document_root(request_rec *r)
{
return ap_document_root(r);
}
static char *req_uri_field(request_rec *r)
{
return r->uri;
@@ -520,7 +519,7 @@ void apl_load_request_lmodule(lua_State *L, apr_pool_t *p)
apr_hash_set(dispatch, "write", APR_HASH_KEY_STRING,
makefun(&req_write, APL_REQ_FUNTYPE_LUACFUN, p));
apr_hash_set(dispatch, "document_root", APR_HASH_KEY_STRING,
makefun(&req_document_root, APL_REQ_FUNTYPE_LUACFUN, p));
makefun(&req_document_root, APL_REQ_FUNTYPE_STRING, p));
apr_hash_set(dispatch, "parseargs", APR_HASH_KEY_STRING,
makefun(&req_parseargs, APL_REQ_FUNTYPE_LUACFUN, p));
apr_hash_set(dispatch, "parsebody", APR_HASH_KEY_STRING,
@@ -544,8 +543,7 @@ void apl_load_request_lmodule(lua_State *L, apr_pool_t *p)
apr_hash_set(dispatch, "add_output_filter", APR_HASH_KEY_STRING,
makefun(&req_add_output_filter, APL_REQ_FUNTYPE_LUACFUN, p));
apr_hash_set(dispatch, "assbackwards", APR_HASH_KEY_STRING,
makefun(&req_assbackwards_field, APL_REQ_FUNTYPE_BOOLEAN,
p));
makefun(&req_assbackwards_field, APL_REQ_FUNTYPE_BOOLEAN, p));
apr_hash_set(dispatch, "status", APR_HASH_KEY_STRING,
makefun(&req_status_field, APL_REQ_FUNTYPE_INT, p));
apr_hash_set(dispatch, "protocol", APR_HASH_KEY_STRING,