]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
change syntax for getting document root in mod_lua to r.document_root, suggested...
authorBrian McCallister <brianm@apache.org>
Sun, 1 Mar 2009 01:37:44 +0000 (01:37 +0000)
committerBrian McCallister <brianm@apache.org>
Sun, 1 Mar 2009 01:37:44 +0000 (01:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@748948 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/lua_request.c

index c829682114ba40026f51d53676b98c5616db3fa1..f97aedf9d421fc089024d28913d23456f8cefc9c 100644 (file)
@@ -211,15 +211,14 @@ static int req_add_output_filter(lua_State *L)
     return 0;
 }
 
-static int req_document_root(lua_State *L)
+/* 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)
 {
-    request_rec *r = apl_check_request_rec(L, 1);
-    lua_pushstring(L, ap_document_root(r));
-    return 1;
+    return ap_document_root(r);
 }
 
-/* BEGIN dispatch mathods for request_rec fields */
-
 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,