You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2012/06/17 00:41:01 UTC

svn commit: r1351014 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_lua.xml modules/lua/lua_request.c

Author: sf
Date: Sat Jun 16 22:41:01 2012
New Revision: 1351014

URL: http://svn.apache.org/viewvc?rev=1351014&view=rev
Log:
mod_lua: Add a few missing request_rec fields. Rename remote_ip to
client_ip to match conn_rec

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/mod_lua.xml
    httpd/httpd/trunk/modules/lua/lua_request.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1351014&r1=1351013&r2=1351014&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Jun 16 22:41:01 2012
@@ -6,6 +6,9 @@ Changes with Apache 2.5.0
      possible XSS for a site where untrusted users can upload files to
      a location with MultiViews enabled. [Niels Heinen <heinenn google.com>]
 
+  *) mod_lua: Add a few missing request_rec fields. Rename remote_ip to
+     client_ip to match conn_rec. [Stefan Fritsch]
+
   *) mod_lua: Change prototype of vm_construct, to work around gcc bug which
      causes a segfault. PR 52779. [Dick Snippe <Dick Snippe tech omroep nl>]
 

Modified: httpd/httpd/trunk/docs/manual/mod/mod_lua.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_lua.xml?rev=1351014&r1=1351013&r2=1351014&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_lua.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_lua.xml Sat Jun 16 22:41:01 2012
@@ -233,6 +233,16 @@ end
           <td>string</td>
           <td>yes</td>
         </tr>
+        <tr>
+          <td><code>context_prefix</code></td>
+          <td>string</td>
+          <td>no</td>
+        </tr>
+        <tr>
+          <td><code>context_document_root</code></td>
+          <td>string</td>
+          <td>no</td>
+        </tr>
 
         <tr>
           <td><code>document_root</code></td>
@@ -271,6 +281,11 @@ end
           <td>no</td>
         </tr>
         <tr>
+          <td><code>log_id</code></td>
+          <td>string</td>
+          <td>no</td>
+        </tr>
+        <tr>
           <td><code>method</code></td>
           <td>string</td>
           <td>no</td>
@@ -330,6 +345,11 @@ end
           <td>string</td>
           <td>yes</td>
         </tr>
+        <tr>
+          <td><code>useragent_ip</code></td>
+          <td>string</td>
+          <td>no</td>
+        </tr>
         </table>
 
         <p>The request_rec has (at least) the following methods:</p>

Modified: httpd/httpd/trunk/modules/lua/lua_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_request.c?rev=1351014&r1=1351013&r2=1351014&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_request.c (original)
+++ httpd/httpd/trunk/modules/lua/lua_request.c Sat Jun 16 22:41:01 2012
@@ -235,6 +235,16 @@ static const char *req_document_root(req
     return ap_document_root(r);
 }
 
+static const char *req_context_prefix(request_rec *r)
+{
+    return ap_context_prefix(r);
+}
+
+static const char *req_context_document_root(request_rec *r)
+{
+    return ap_context_document_root(r);
+}
+
 static char *req_uri_field(request_rec *r)
 {
     return r->uri;
@@ -323,6 +333,16 @@ static const char *req_the_request_field
     return r->the_request;
 }
 
+static const char *req_log_id_field(request_rec *r)
+{
+    return r->log_id;
+}
+
+static const char *req_useragent_ip_field(request_rec *r)
+{
+    return r->useragent_ip;
+}
+
 static int req_status_field(request_rec *r)
 {
     return r->status;
@@ -599,6 +619,10 @@ AP_LUA_DECLARE(void) ap_lua_load_request
                  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_STRING, p));
+    apr_hash_set(dispatch, "context_prefix", APR_HASH_KEY_STRING,
+                 makefun(&req_context_prefix, APL_REQ_FUNTYPE_STRING, p));
+    apr_hash_set(dispatch, "context_document_root", APR_HASH_KEY_STRING,
+                 makefun(&req_context_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, "debug", APR_HASH_KEY_STRING,
@@ -679,6 +703,10 @@ AP_LUA_DECLARE(void) ap_lua_load_request
                  makefun(&req_uri_field, APL_REQ_FUNTYPE_STRING, p));
     apr_hash_set(dispatch, "the_request", APR_HASH_KEY_STRING,
                  makefun(&req_the_request_field, APL_REQ_FUNTYPE_STRING, p));
+    apr_hash_set(dispatch, "log_id", APR_HASH_KEY_STRING,
+                 makefun(&req_log_id_field, APL_REQ_FUNTYPE_STRING, p));
+    apr_hash_set(dispatch, "useragent_ip", APR_HASH_KEY_STRING,
+                 makefun(&req_useragent_ip_field, APL_REQ_FUNTYPE_STRING, p));
     apr_hash_set(dispatch, "method", APR_HASH_KEY_STRING,
                  makefun(&req_method_field, APL_REQ_FUNTYPE_STRING, p));
     apr_hash_set(dispatch, "proxyreq", APR_HASH_KEY_STRING,
@@ -735,7 +763,7 @@ AP_LUA_DECLARE(void) ap_lua_push_connect
     lua_setfield(L, -2, "notes");
 
     lua_pushstring(L, c->client_ip);
-    lua_setfield(L, -2, "remote_ip");
+    lua_setfield(L, -2, "client_ip");
 
     lua_pop(L, 1);
 }