httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject svn commit: r748948 - /httpd/httpd/trunk/modules/lua/lua_request.c
Date Sun, 01 Mar 2009 01:37:44 GMT
Author: brianm
Date: Sun Mar  1 01:37:44 2009
New Revision: 748948

URL: http://svn.apache.org/viewvc?rev=748948&view=rev
Log:
change syntax for getting document root in mod_lua to r.document_root, suggested by Bertrand
Mansion

Modified:
    httpd/httpd/trunk/modules/lua/lua_request.c

Modified: httpd/httpd/trunk/modules/lua/lua_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_request.c?rev=748948&r1=748947&r2=748948&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_request.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_request.c Sun Mar  1 01:37:44 2009
@@ -211,15 +211,14 @@
     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 @@
     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 @@
     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,



Mime
View raw message