You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2011/12/14 01:31:52 UTC

svn commit: r1214003 - in /httpd/httpd/trunk: docs/manual/developer/ include/ modules/aaa/ modules/arch/netware/ modules/filters/ modules/http/ modules/loggers/ modules/mappers/ modules/metadata/ modules/proxy/ modules/ssl/

Author: minfrin
Date: Wed Dec 14 00:31:51 2011
New Revision: 1214003

URL: http://svn.apache.org/viewvc?rev=1214003&view=rev
Log:
Further clarify the naming of the entity that originates the request by
calling that entity a useragent instead of a client.

Modified:
    httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml
    httpd/httpd/trunk/include/httpd.h
    httpd/httpd/trunk/modules/aaa/mod_access_compat.c
    httpd/httpd/trunk/modules/aaa/mod_authz_host.c
    httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c
    httpd/httpd/trunk/modules/filters/mod_ext_filter.c
    httpd/httpd/trunk/modules/http/http_request.c
    httpd/httpd/trunk/modules/loggers/mod_log_config.c
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c
    httpd/httpd/trunk/modules/metadata/mod_remoteip.c
    httpd/httpd/trunk/modules/metadata/mod_setenvif.c
    httpd/httpd/trunk/modules/proxy/ajp_header.c
    httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
    httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
    httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c

Modified: httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml (original)
+++ httpd/httpd/trunk/docs/manual/developer/new_api_2_4.xml Wed Dec 14 00:31:51 2011
@@ -466,11 +466,11 @@
       variables, they need to be replaced with one of the following two
       options as appropriate for the module:
       <ul>
-        <li>When you require the IP address of the client, which might
-        be connected directly to the server, or might optionally be
+        <li>When you require the IP address of the user agent, which
+        might be connected directly to the server, or might optionally be
         separated from the server by a transparent load balancer or
-        proxy, use request_rec->client_ip and
-        request_rec->client_addr.</li>
+        proxy, use request_rec->useragent_ip and
+        request_rec->useragent_addr.</li>
         <li>When you require the IP address of the peer that is
         connected directly to the server, which might be the client or
         might be the load balancer or proxy itself, use

Modified: httpd/httpd/trunk/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/httpd.h?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/include/httpd.h (original)
+++ httpd/httpd/trunk/include/httpd.h Wed Dec 14 00:31:51 2011
@@ -1008,8 +1008,8 @@ struct request_rec {
     /** remote address information from conn_rec, can be overridden if
      * necessary by a module.
      */
-    apr_sockaddr_t *client_addr;
-    char *client_ip;
+    apr_sockaddr_t *useragent_addr;
+    char *useragent_ip;
 };
 
 /**

Modified: httpd/httpd/trunk/modules/aaa/mod_access_compat.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_access_compat.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_access_compat.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_access_compat.c Wed Dec 14 00:31:51 2011
@@ -271,7 +271,7 @@ static int find_allowdeny(request_rec *r
             return 1;
 
         case T_IP:
-            if (apr_ipsubnet_test(ap[i].x.ip, r->client_addr)) {
+            if (apr_ipsubnet_test(ap[i].x.ip, r->useragent_addr)) {
                 return 1;
             }
             break;

Modified: httpd/httpd/trunk/modules/aaa/mod_authz_host.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/mod_authz_host.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authz_host.c (original)
+++ httpd/httpd/trunk/modules/aaa/mod_authz_host.c Wed Dec 14 00:31:51 2011
@@ -153,7 +153,7 @@ static authz_status ip_check_authorizati
     apr_ipsubnet_t **ip = (apr_ipsubnet_t **)parsed_require_line;
 
     while (*ip) {
-        if (apr_ipsubnet_test(*ip, r->client_addr))
+        if (apr_ipsubnet_test(*ip, r->useragent_addr))
             return AUTHZ_GRANTED;
         ip++;
     }
@@ -201,10 +201,10 @@ static authz_status local_check_authoriz
                                               const void *parsed_require_line)
 {
      if (   apr_sockaddr_equal(r->connection->local_addr,
-                               r->client_addr)
-         || apr_ipsubnet_test(localhost_v4, r->client_addr)
+                               r->useragent_addr)
+         || apr_ipsubnet_test(localhost_v4, r->useragent_addr)
 #if APR_HAVE_IPV6
-         || apr_ipsubnet_test(localhost_v6, r->client_addr)
+         || apr_ipsubnet_test(localhost_v6, r->useragent_addr)
 #endif
         )
      {

Modified: httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c (original)
+++ httpd/httpd/trunk/modules/arch/netware/mod_nw_ssl.c Wed Dec 14 00:31:51 2011
@@ -1001,7 +1001,7 @@ char *ssl_var_lookup(apr_pool_t *p, serv
             else if (strcEQ(var, "REQUEST_FILENAME"))
                 result = r->filename;
             else if (strcEQ(var, "REMOTE_ADDR"))
-                result = r->client_ip;
+                result = r->useragent_ip;
             else if (strcEQ(var, "REMOTE_HOST"))
                 result = ap_get_remote_host(r->connection, r->per_dir_config,
                                             REMOTE_NAME, NULL);

Modified: httpd/httpd/trunk/modules/filters/mod_ext_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_ext_filter.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_ext_filter.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_ext_filter.c Wed Dec 14 00:31:51 2011
@@ -406,7 +406,7 @@ static void child_errfn(apr_pool_t *pool
     apr_file_printf(stderr_log,
                     "[%s] [client %s] mod_ext_filter (%d)%s: %s\n",
                     time_str,
-                    r->client_ip,
+                    r->useragent_ip,
                     err,
                     apr_strerror(err, errbuf, sizeof(errbuf)),
                     description);

Modified: httpd/httpd/trunk/modules/http/http_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_request.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_request.c (original)
+++ httpd/httpd/trunk/modules/http/http_request.c Wed Dec 14 00:31:51 2011
@@ -439,8 +439,8 @@ static request_rec *internal_internal_re
     new->prev = r;
     r->next   = new;
 
-    new->client_addr = r->client_addr;
-    new->client_ip = r->client_ip;
+    new->useragent_addr = r->useragent_addr;
+    new->useragent_ip = r->useragent_ip;
 
     /* Must have prev and next pointers set before calling create_request
      * hook.

Modified: httpd/httpd/trunk/modules/loggers/mod_log_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/loggers/mod_log_config.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/loggers/mod_log_config.c (original)
+++ httpd/httpd/trunk/modules/loggers/mod_log_config.c Wed Dec 14 00:31:51 2011
@@ -314,7 +314,7 @@ static const char *log_remote_address(re
         return r->connection->peer_ip;
     }
     else {
-        return r->client_ip;
+        return r->useragent_ip;
     }
 }
 
@@ -763,7 +763,7 @@ static const char *log_server_port(reque
         port = r->server->port ? r->server->port : ap_default_port(r);
     }
     else if (!strcasecmp(a, "remote")) {
-        port = r->client_addr->port;
+        port = r->useragent_addr->port;
     }
     else if (!strcasecmp(a, "local")) {
         port = r->connection->local_addr->port;

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Wed Dec 14 00:31:51 2011
@@ -1861,7 +1861,7 @@ static char *lookup_variable(char *var, 
             else if (!strcmp(var, "IPV6")) {
                 int flag = FALSE;
 #if APR_HAVE_IPV6
-                apr_sockaddr_t *addr = r->client_addr;
+                apr_sockaddr_t *addr = r->useragent_addr;
                 flag = (addr->family == AF_INET6 &&
                         !IN6_IS_ADDR_V4MAPPED((struct in6_addr *)addr->ipaddr_ptr));
                 rewritelog((r, 1, ctx->perdir, "IPV6='%s'", flag ? "on" : "off"));
@@ -1967,7 +1967,7 @@ static char *lookup_variable(char *var, 
 
             case 'D':
                 if (*var == 'R' && !strcmp(var, "REMOTE_ADDR")) {
-                    result = r->client_ip;
+                    result = r->useragent_ip;
                 }
                 else if (!strcmp(var, "SERVER_ADDR")) {
                     result = r->connection->local_ip;
@@ -2006,7 +2006,7 @@ static char *lookup_variable(char *var, 
                                                 REMOTE_NAME, NULL);
                 }
                 else if (!strcmp(var, "REMOTE_PORT")) {
-                    return apr_itoa(r->pool, r->client_addr->port);
+                    return apr_itoa(r->pool, r->useragent_addr->port);
                 }
                 break;
 

Modified: httpd/httpd/trunk/modules/metadata/mod_remoteip.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_remoteip.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_remoteip.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_remoteip.c Wed Dec 14 00:31:51 2011
@@ -51,8 +51,8 @@ typedef struct {
 } remoteip_config_t;
 
 typedef struct {
-    apr_sockaddr_t *client_addr;
-    char *client_ip;
+    apr_sockaddr_t *useragent_addr;
+    char *useragent_ip;
     /** The list of proxy ip's ignored as remote ip's */
     const char *proxy_ips;
     /** The remaining list of untrusted proxied remote ip's */
@@ -367,8 +367,8 @@ static int remoteip_modify_request(reque
             }
         }
 
-        req->client_addr = temp_sa;
-        apr_sockaddr_ip_get(&req->client_ip, req->client_addr);
+        req->useragent_addr = temp_sa;
+        apr_sockaddr_ip_get(&req->useragent_ip, req->useragent_addr);
     }
 
     /* Nothing happened? */
@@ -394,14 +394,14 @@ static int remoteip_modify_request(reque
         }
     }
 
-    r->client_addr = req->client_addr;
-    r->client_ip = req->client_ip;
+    r->useragent_addr = req->useragent_addr;
+    r->useragent_ip = req->useragent_ip;
 
     ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
                   req->proxy_ips
                       ? "Using %s as client's IP by proxies %s"
                       : "Using %s as client's IP by internal proxies",
-                  req->client_ip, req->proxy_ips);
+                  req->useragent_ip, req->proxy_ips);
     return OK;
 }
 

Modified: httpd/httpd/trunk/modules/metadata/mod_setenvif.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_setenvif.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_setenvif.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_setenvif.c Wed Dec 14 00:31:51 2011
@@ -527,7 +527,7 @@ static int match_headers(request_rec *r)
                 last_name = b->name;
                 switch (b->special_type) {
                 case SPECIAL_REMOTE_ADDR:
-                    val = r->client_ip;
+                    val = r->useragent_ip;
                     break;
                 case SPECIAL_SERVER_ADDR:
                     val = r->connection->local_ip;

Modified: httpd/httpd/trunk/modules/proxy/ajp_header.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/ajp_header.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/ajp_header.c (original)
+++ httpd/httpd/trunk/modules/proxy/ajp_header.c Wed Dec 14 00:31:51 2011
@@ -247,7 +247,7 @@ static apr_status_t ajp_marshal_into_msg
         ajp_msg_append_uint8(msg, (apr_byte_t) method)           ||
         ajp_msg_append_string(msg, r->protocol)                  ||
         ajp_msg_append_string(msg, uri->path)                    ||
-        ajp_msg_append_string(msg, r->client_ip)                 ||
+        ajp_msg_append_string(msg, r->useragent_ip)              ||
         ajp_msg_append_string(msg, remote_host)                  ||
         ajp_msg_append_string(msg, ap_get_server_name(r))        ||
         ajp_msg_append_uint16(msg, (apr_uint16_t)r->connection->local_addr->port) ||
@@ -413,7 +413,7 @@ static apr_status_t ajp_marshal_into_msg
      */
     {
         const char *key = SC_A_REQ_REMOTE_PORT;
-        char *val = apr_itoa(r->pool, r->client_addr->port);
+        char *val = apr_itoa(r->pool, r->useragent_addr->port);
         if (ajp_msg_append_uint8(msg, SC_A_REQ_ATTRIBUTE) ||
             ajp_msg_append_string(msg, key)   ||
             ajp_msg_append_string(msg, val)) {

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_http.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_http.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_http.c Wed Dec 14 00:31:51 2011
@@ -908,7 +908,7 @@ int ap_proxy_http_request(apr_pool_t *p,
             * determine, where the original request came from.
             */
            apr_table_mergen(r->headers_in, "X-Forwarded-For",
-                            r->client_ip);
+                            r->useragent_ip);
 
            /* Add X-Forwarded-Host: so that upstream knows what the
             * original request hostname was.
@@ -1295,8 +1295,8 @@ static request_rec *make_fake_req(conn_r
     rp->input_filters   = c->input_filters;
     rp->proto_output_filters  = c->output_filters;
     rp->proto_input_filters   = c->input_filters;
-    rp->client_ip = c->peer_ip;
-    rp->client_addr = c->peer_addr;
+    rp->useragent_ip = c->peer_ip;
+    rp->useragent_addr = c->peer_addr;
 
     rp->request_config  = ap_create_request_config(pool);
     proxy_run_create_req(r, rp);

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c Wed Dec 14 00:31:51 2011
@@ -918,7 +918,7 @@ int ssl_hook_Access(request_rec *r)
             ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02266)
                           "Access to %s denied for %s "
                           "(requirement expression not fulfilled)",
-                          r->filename, r->client_ip);
+                          r->filename, r->useragent_ip);
 
             ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02228)
                           "Failed expression: %s", req->cpExpr);

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c?rev=1214003&r1=1214002&r2=1214003&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c Wed Dec 14 00:31:51 2011
@@ -188,7 +188,7 @@ char *ssl_var_lookup(apr_pool_t *p, serv
             else if (strcEQ(var, "REQUEST_FILENAME"))
                 result = r->filename;
             else if (strcEQ(var, "REMOTE_ADDR"))
-                result = r->client_ip;
+                result = r->useragent_ip;
             else if (strcEQ(var, "REMOTE_HOST"))
                 result = ap_get_remote_host(r->connection, r->per_dir_config,
                                             REMOTE_NAME, NULL);