]> granicus.if.org Git - apache/commitdiff
Backport:
authorGraham Leggett <minfrin@apache.org>
Wed, 14 Dec 2011 01:32:31 +0000 (01:32 +0000)
committerGraham Leggett <minfrin@apache.org>
Wed, 14 Dec 2011 01:32:31 +0000 (01:32 +0000)
Further clarify the naming of the entity that originates the request by
calling that entity a useragent instead of a client.
Further clarify the naming of the entity that directly connects to us by
calling that entity a client instead of a peer.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1214022 13f79535-47bb-0310-9956-ffa450edef68

26 files changed:
docs/manual/developer/new_api_2_4.xml
docs/manual/mod/mod_remoteip.xml
include/httpd.h
modules/aaa/mod_access_compat.c
modules/aaa/mod_authz_host.c
modules/arch/netware/mod_nw_ssl.c
modules/cluster/mod_heartmonitor.c
modules/echo/mod_echo.c
modules/filters/mod_ext_filter.c
modules/http/http_request.c
modules/loggers/mod_log_config.c
modules/lua/lua_request.c
modules/mappers/mod_rewrite.c
modules/metadata/mod_ident.c
modules/metadata/mod_remoteip.c
modules/metadata/mod_setenvif.c
modules/proxy/ajp_header.c
modules/proxy/mod_proxy_http.c
modules/ssl/ssl_engine_kernel.c
modules/ssl/ssl_engine_vars.c
server/core.c
server/log.c
server/protocol.c
server/request.c
server/util_expr_eval.c
server/util_script.c

index 53984834c7cc1d83c77e4f7381d3e665c8cb68ad..d737bb3bc10ef76d9669c332a6ab29f70fe2dc00 100644 (file)
       <li>Modules that load other modules later than the EXEC_ON_READ config
           reading stage need to call ap_reserve_module_slots() or
           ap_reserve_module_slots_directive() in their pre_config hook.</li>
-      <li>The client IP address per request can now be specified independently
-          of the peer IP address of the connection for the benefit of load
-          balancers</li>
+      <li>The useragent IP address per request can now be specified
+          independently of the client IP address of the connection for
+          the benefit of load balancers</li>
     </ul>
   </section>
 
       <dd>This has been renamed to ap_unixd_config.</dd>
 
       <dt><code>conn_rec->remote_ip and conn_rec->remote_addr</code></dt>
-      <dd>In order to distinguish between the peer IP address of the
-      connection, and the client IP address of the request potentially
+      <dd>In order to distinguish between the client IP address of the
+      connection, and the useragent IP address of the request potentially
       overridden by a load balancer or proxy, the above variables have
       been renamed. If a module makes reference to either of the above
       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>
-        <li>When you require the IP address of the peer that is
-        connected directly to the server, which might be the client or
+        proxy, use request_rec->useragent_ip and
+        request_rec->useragent_addr.</li>
+        <li>When you require the IP address of the client that is
+        connected directly to the server, which might be the useragent or
         might be the load balancer or proxy itself, use
-        conn_rec->peer_ip and conn_rec->peer_addr.</li>
+        conn_rec->client_ip and conn_rec->client_addr.</li>
       </ul>
       </dd>
     </dl>
index 14ad97ed333a2f3a153464731b8b44444edceb0c..cfe6d2380d15613d07a1b89aa0512f09bc221777 100644 (file)
@@ -23,8 +23,8 @@
 <modulesynopsis metafile="mod_remoteip.xml.meta">
 
 <name>mod_remoteip</name>
-<description>Replaces the original peer IP address for the connection
-with the client IP address list presented by a proxies or a load balancer
+<description>Replaces the original client IP address for the connection
+with the useragent IP address list presented by a proxies or a load balancer
 via the request headers.
 </description>
 
@@ -33,26 +33,27 @@ via the request headers.
 <identifier>remoteip_module</identifier>
 
 <summary>
-    <p>This module is used to treat the client which initiated the
-    request as the originating client as identified by httpd for the
-    purposes of authorization and logging, even where that client is
+    <p>This module is used to treat the useragent which initiated the
+    request as the originating useragent as identified by httpd for the
+    purposes of authorization and logging, even where that useragent is
     behind a load balancer, front end server, or proxy server.</p>
 
-    <p>The module overrides the peer IP address for the connection
-    with the client IP address reported in the request header configured
+    <p>The module overrides the client IP address for the connection
+    with the useragent IP address reported in the request header configured
     with the <directive>RemoteIPHeader</directive> directive.</p>
 
-    <p>Once replaced as instructed, this overridden client IP address is
+    <p>Once replaced as instructed, this overridden useragent IP address is
     then used for the <module>mod_authz_host</module>
     <directive module="mod_authz_host" type="section">Require ip</directive>
     feature, is reported by <module>mod_status</module>, and is recorded by
     <module>mod_log_config</module> <code>%a</code> and <module>core</module>
-    <code>%a</code> format strings. The underlying peer IP of the connection
+    <code>%a</code> format strings. The underlying client IP of the connection
     is available in the <code>%{c}a</code> format string.</p>
 
     <note type="warning">It is critical to only enable this behavior from
     intermediate hosts (proxies, etc) which are trusted by this server, since
-    it is trivial for the remote client to impersonate another client.</note>
+    it is trivial for the remote useragent to impersonate another
+    useragent.</note>
 </summary>
 
 <seealso><module>mod_authz_host</module></seealso>
@@ -61,22 +62,22 @@ via the request headers.
 
 <section id="processing"><title>Remote IP Processing</title>
 
-    <p>Apache by default identifies the client with the connection's
-    peer_ip value, and the connection remote_host and remote_logname are
+    <p>Apache by default identifies the useragent with the connection's
+    client_ip value, and the connection remote_host and remote_logname are
     derived from this value. These fields play a role in authentication,
     authorization and logging and other purposes by other loadable
     modules.</p>
 
-    <p>mod_remoteip overrides the peer IP of the connection with the
-    advertised client IP as provided by a proxy or load balancer, for
+    <p>mod_remoteip overrides the client IP of the connection with the
+    advertised useragent IP as provided by a proxy or load balancer, for
     the duration of the request. A load balancer might establish a long
     lived keepalive connection with the server, and each request will
-    have the correct client IP, even though the underlying peer IP
+    have the correct useragent IP, even though the underlying client IP
     address of the load balancer remains unchanged.</p>
 
-    <p>When multiple, comma delimited client IP addresses are listed in the
+    <p>When multiple, comma delimited useragent IP addresses are listed in the
     header value, they are processed in Right-to-Left order.  Processing
-    halts when a given client IP address is not trusted to present the
+    halts when a given useragent IP address is not trusted to present the
     preceding IP address.  The header field is updated to this remaining
     list of unconfirmed IP addresses, or if all IP addresses were trusted,
     this header is removed from the request altogether.</p>
@@ -102,15 +103,15 @@ via the request headers.
 
 <directivesynopsis>
 <name>RemoteIPHeader</name>
-<description>Declare the header field which should be parsed for client IP addresses</description>
+<description>Declare the header field which should be parsed for useragent IP addresses</description>
 <syntax>RemoteIPHeader <var>header-field</var></syntax>
 <contextlist><context>server config</context><context>virtual host</context></contextlist>
 
 <usage>
     <p>The <directive>RemoteIPHeader</directive> directive triggers
     <module>mod_remoteip</module> to treat the value of the specified
-    <var>header-field</var> header as the client IP address, or list
-    of intermediate client IP addresses, subject to further configuration
+    <var>header-field</var> header as the useragent IP address, or list
+    of intermediate useragent IP addresses, subject to further configuration
     of the <directive>RemoteIPInternalProxy</directive> and
     <directive>RemoteIPTrustedProxy</directive> directives.  Unless these
     other directives are used, <module>mod_remoteip</module> will trust all
@@ -135,7 +136,7 @@ via the request headers.
 <usage>
     <p>The <directive>RemoteIPInternalProxy</directive> directive adds one
     or more addresses (or address blocks) to trust as presenting a valid
-    RemoteIPHeader value of the client IP.  Unlike the
+    RemoteIPHeader value of the useragent IP.  Unlike the
     <directive>RemoteIPTrustedProxy</directive> directive, any IP address
     presented in this header, including private intranet addresses, are
     trusted when passed from these proxies.</p>
@@ -157,7 +158,7 @@ via the request headers.
 <usage>
     <p>The <directive>RemoteIPInternalProxyList</directive> directive specifies
     a file parsed at startup, and builds a list of addresses (or address blocks)
-    to trust as presenting a valid RemoteIPHeader value of the client IP.</p>
+    to trust as presenting a valid RemoteIPHeader value of the useragent IP.</p>
 
     <p>The '<code>#</code>' hash character designates a comment line, otherwise
     each whitespace or newline separated entry is processed identically to
@@ -185,7 +186,7 @@ via the request headers.
 <usage>
     <p>The <directive>RemoteIPProxiesHeader</directive> directive specifies
     a header into which <module>mod_remoteip</module> will collect a list of
-    all of the intermediate client IP addresses trusted to resolve the client
+    all of the intermediate client IP addresses trusted to resolve the useragent
     IP of the request. Note that intermediate
     <directive>RemoteIPTrustedProxy</directive> addresses are recorded in
     this header, while any intermediate
@@ -207,11 +208,11 @@ via the request headers.
 <usage>
     <p>The <directive>RemoteIPTrustedProxy</directive> directive adds one
     or more addresses (or address blocks) to trust as presenting a valid
-    RemoteIPHeader value of the client IP.  Unlike the
+    RemoteIPHeader value of the useragent IP.  Unlike the
     <directive>RemoteIPInternalProxy</directive> directive, any intranet
     or private IP address reported by such proxies, including the 10/8, 172.16/12,
     192.168/16, 169.254/16 and 127/8 blocks (or outside of the IPv6 public
-    2000::/3 block) are not trusted as the client IP, and are left in the
+    2000::/3 block) are not trusted as the useragent IP, and are left in the
     <directive>RemoteIPHeader</directive> header's value.</p>
 
     <example><title>Trusted (Load Balancer) Example</title>
@@ -231,7 +232,7 @@ via the request headers.
 <usage>
     <p>The <directive>RemoteIPTrustedProxyList</directive> directive specifies
     a file parsed at startup, and builds a list of addresses (or address blocks)
-    to trust as presenting a valid RemoteIPHeader value of the client IP.</p>
+    to trust as presenting a valid RemoteIPHeader value of the useragent IP.</p>
 
     <p>The '<code>#</code>' hash character designates a comment line, otherwise
     each whitespace or newline seperated entry is processed identically to
index d7f7784dfd9a620c9efd7d23bb02762462858fed..71b4c0dcf7e67bcca7d7deee4c1b6afad029d6c2 100644 (file)
@@ -1007,8 +1007,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;
 };
 
 /**
@@ -1052,10 +1052,10 @@ struct conn_rec {
     /** local address */
     apr_sockaddr_t *local_addr;
     /** remote address */
-    apr_sockaddr_t *peer_addr;
+    apr_sockaddr_t *client_addr;
 
     /** Client's IP address */
-    char *peer_ip;
+    char *client_ip;
     /** Client's DNS name, if known.  NULL if DNS hasn't been checked,
      *  "" if it has and no address was found.  N.B. Only access this though
      * get_remote_host() */
index 59122a9832c02dbfa9b17cd3a9676ff292c07235..8d7afca19f088878df1efb41eab4f85cdcf189c7 100644 (file)
@@ -271,7 +271,7 @@ static int find_allowdeny(request_rec *r, apr_array_header_t *a, int method)
             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;
index e3108e8badb55388f3575de20588a6407fb15d8c..908767617315afce85eabc771380df5d3afb8a4e 100644 (file)
@@ -153,7 +153,7 @@ static authz_status ip_check_authorization(request_rec *r,
     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_authorization(request_rec *r,
                                               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
         )
      {
index 22418d34401adfb420339d52d59b045423b73ae9..84aa6fbee7ea1d1fa66f4ecd1b63fd11007adde0 100644 (file)
@@ -1001,7 +1001,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r,
             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);
index 8b610e6e79d53d6028b859e011f3cd7b8e7df839..b72e196a895366c1d031b1f2c5d94024d858ef83 100644 (file)
@@ -761,7 +761,7 @@ static int hm_handler(request_rec *r)
     buf[len] = '\0';
     tbl = apr_table_make(r->pool, 10);
     qs_to_table(buf, tbl, r->pool);
-    apr_sockaddr_ip_get(&ip, r->connection->peer_addr);
+    apr_sockaddr_ip_get(&ip, r->connection->client_addr);
     hmserver.ip = ip;
     hmserver.port = 80;
     if (apr_table_get(tbl, "port") != NULL)
index e2c45620d5cae54fbeebb4583588c9ab869be425..b8943363cd7465e3b3659086306812b11dfac1a5 100644 (file)
@@ -154,7 +154,7 @@ static int process_echo_connection(conn_rec *c)
             if (!APR_STATUS_IS_EOF(rv) && ! APR_STATUS_IS_TIMEUP(rv))
                 ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server, APLOGNO(01611)
                              "ProtocolEcho: Failure reading from %s",
-                             c->peer_ip);
+                             c->client_ip);
             break;
         }
 
@@ -163,7 +163,7 @@ static int process_echo_connection(conn_rec *c)
             apr_brigade_cleanup(bb);
             ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server, APLOGNO(01612)
                          "ProtocolEcho: Error - read empty brigade from %s!",
-                         c->peer_ip);
+                         c->client_ip);
             break;
         }
 
@@ -181,7 +181,7 @@ static int process_echo_connection(conn_rec *c)
         if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server, APLOGNO(01613)
                          "ProtocolEcho: Failure writing to %s",
-                         c->peer_ip);
+                         c->client_ip);
             break;
         }
         apr_brigade_cleanup(bb);
index d223e9418fafe80bc922a9517db3e2e2df22a1b3..3412c21d38cbb1e088e9e18edadc89e13d1c0dff 100644 (file)
@@ -406,7 +406,7 @@ static void child_errfn(apr_pool_t *pool, apr_status_t err, const char *descript
     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);
index 2788ec96f7d5a10aa5a9f26c73edf329c2c02cf4..ce16de922b3be1a627dc2a52f03e7f7c4181a5ca 100644 (file)
@@ -439,8 +439,8 @@ static request_rec *internal_internal_redirect(const char *new_uri,
     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.
index 2b3cd53bba4ce487d68867a6880abc390ec4163b..0f35e6b965c2263548f9b6ff7ff5b2193379182e 100644 (file)
@@ -311,10 +311,10 @@ static const char *log_remote_host(request_rec *r, char *a)
 static const char *log_remote_address(request_rec *r, char *a)
 {
     if (a && !strcmp(a, "c")) {
-        return r->connection->peer_ip;
+        return r->connection->client_ip;
     }
     else {
-        return r->client_ip;
+        return r->useragent_ip;
     }
 }
 
@@ -763,7 +763,7 @@ static const char *log_server_port(request_rec *r, char *a)
         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;
index cce3a9ce4f631823e080a59123b1b18787c98e45..614f81dbd1406b344c8ff2f34e79333924f44a66 100644 (file)
@@ -743,7 +743,7 @@ AP_LUA_DECLARE(void) ap_lua_push_connection(lua_State *L, conn_rec *c)
     ap_lua_push_apr_table(L, c->notes);
     lua_setfield(L, -2, "notes");
 
-    lua_pushstring(L, c->peer_ip);
+    lua_pushstring(L, c->client_ip);
     lua_setfield(L, -2, "remote_ip");
 
     lua_pop(L, 1);
index 970faff1d94b77fda0d7201255c6831a0a68375b..17f52cba2473452b40c1bec6ca3bff0a5b7d703c 100644 (file)
@@ -1861,7 +1861,7 @@ static char *lookup_variable(char *var, rewrite_ctx *ctx)
             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, rewrite_ctx *ctx)
 
             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, rewrite_ctx *ctx)
                                                 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;
 
index 846468006654f7961246c3e0ef02dd06d5b95eeb..06295ef3ab18859044e3c731dd759a97fce5b95f 100644 (file)
@@ -101,14 +101,14 @@ static apr_status_t rfc1413_connect(apr_socket_t **newsock, conn_rec *conn,
         return rv;
     }
 
-    if ((rv = apr_sockaddr_info_get(&destsa, conn->peer_ip,
+    if ((rv = apr_sockaddr_info_get(&destsa, conn->client_ip,
                               localsa->family, /* has to match */
                               RFC1413_PORT, 0, conn->pool)) != APR_SUCCESS) {
         /* This should not fail since we have a numeric address string
          * as the host. */
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, srv, APLOGNO(01493)
                      "rfc1413: apr_sockaddr_info_get(%s) failed",
-                     conn->peer_ip);
+                     conn->client_ip);
         return rv;
     }
 
@@ -167,7 +167,7 @@ static apr_status_t rfc1413_query(apr_socket_t *sock, conn_rec *conn,
     apr_size_t buflen;
 
     sav_our_port = conn->local_addr->port;
-    sav_rmt_port = conn->peer_addr->port;
+    sav_rmt_port = conn->client_addr->port;
 
     /* send the data */
     buflen = apr_snprintf(buffer, sizeof(buffer), "%hu,%hu\r\n", sav_rmt_port,
index aa9ae4e230b36f3a924a9972240de4062a51b42f..d2858cc10e79ac5a89687e3e1e4f63e987bc79bf 100644 (file)
@@ -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 */
@@ -243,18 +243,18 @@ static int remoteip_modify_request(request_rec *r)
     }
     remote = apr_pstrdup(r->pool, remote);
 
-    temp_sa = c->peer_addr;
+    temp_sa = c->client_addr;
 
     while (remote) {
 
-        /* verify c->peer_addr is trusted if there is a trusted proxy list
+        /* verify c->client_addr is trusted if there is a trusted proxy list
          */
         if (config->proxymatch_ip) {
             int i;
             remoteip_proxymatch_t *match;
             match = (remoteip_proxymatch_t *)config->proxymatch_ip->elts;
             for (i = 0; i < config->proxymatch_ip->nelts; ++i) {
-                if (apr_ipsubnet_test(match[i].ip, c->peer_addr)) {
+                if (apr_ipsubnet_test(match[i].ip, c->client_addr)) {
                     internal = match[i].internal;
                     break;
                 }
@@ -356,19 +356,19 @@ static int remoteip_modify_request(request_rec *r)
             req = (remoteip_req_t *) apr_palloc(r->pool, sizeof(remoteip_req_t));
         }
 
-        /* Set peer_ip string */
+        /* Set useragent_ip string */
         if (!internal) {
             if (proxy_ips) {
                 proxy_ips = apr_pstrcat(r->pool, proxy_ips, ", ",
-                                        c->peer_ip, NULL);
+                                        c->client_ip, NULL);
             }
             else {
-                proxy_ips = c->peer_ip;
+                proxy_ips = c->client_ip;
             }
         }
 
-        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(request_rec *r)
         }
     }
 
-    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;
 }
 
index dbbf34d51586639eed51d61c5922dd587fbdcd27..80825ccefa0729ccc2ace5491bc7302905be92ec 100644 (file)
@@ -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;
index 4c7aad02ace54769119ce68154aee67fc09d48c4..e7e1696996a5e27f4b4b436240ad063cf7d8c60b 100644 (file)
@@ -247,7 +247,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *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_msgb(ajp_msg_t *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)) {
index f339ec1cd56e54458087e605633a3affbca5f103..64b95a2fb791700779a0bc23cf5065a05ce625fb 100644 (file)
@@ -532,7 +532,7 @@ static int stream_reqbody_cl(apr_pool_t *p,
     if (bytes_streamed != cl_val) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01087)
                       "client %s given Content-Length did not match"
-                      " number of body bytes read", r->connection->peer_ip);
+                      " number of body bytes read", r->connection->client_ip);
         return HTTP_BAD_REQUEST;
     }
 
@@ -908,7 +908,7 @@ int ap_proxy_http_request(apr_pool_t *p, request_rec *r,
             * 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.
@@ -1052,7 +1052,7 @@ int ap_proxy_http_request(apr_pool_t *p, request_rec *r,
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01094)
                       "client %s (%s) requested Transfer-Encoding "
                       "chunked body with Content-Length (C-L ignored)",
-                      c->peer_ip, c->remote_host ? c->remote_host: "");
+                      c->client_ip, c->remote_host ? c->remote_host: "");
         apr_table_unset(r->headers_in, "Content-Length");
         old_cl_val = NULL;
         origin->keepalive = AP_CONN_CLOSE;
@@ -1077,7 +1077,7 @@ int ap_proxy_http_request(apr_pool_t *p, request_rec *r,
                           "prefetch request body failed to %pI (%s)"
                           " from %s (%s)",
                           p_conn->addr, p_conn->hostname ? p_conn->hostname: "",
-                          c->peer_ip, c->remote_host ? c->remote_host: "");
+                          c->client_ip, c->remote_host ? c->remote_host: "");
             return HTTP_BAD_REQUEST;
         }
 
@@ -1099,7 +1099,7 @@ int ap_proxy_http_request(apr_pool_t *p, request_rec *r,
                           "processing prefetched request body failed"
                           " to %pI (%s) from %s (%s)",
                           p_conn->addr, p_conn->hostname ? p_conn->hostname: "",
-                          c->peer_ip, c->remote_host ? c->remote_host: "");
+                          c->client_ip, c->remote_host ? c->remote_host: "");
             return HTTP_INTERNAL_SERVER_ERROR;
         }
 
@@ -1238,7 +1238,7 @@ skip_body:
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01097)
                       "pass request body failed to %pI (%s) from %s (%s)",
                       p_conn->addr, p_conn->hostname ? p_conn->hostname: "",
-                      c->peer_ip, c->remote_host ? c->remote_host: "");
+                      c->client_ip, c->remote_host ? c->remote_host: "");
         return rv;
     }
 
@@ -1295,8 +1295,8 @@ static request_rec *make_fake_req(conn_rec *c, request_rec *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->client_ip;
+    rp->useragent_addr = c->client_addr;
 
     rp->request_config  = ap_create_request_config(pool);
     proxy_run_create_req(r, rp);
index 3165da90d0f935ca04b7ce1bdf8dd0f3cf64bfc3..a4703933b6654500c2f8f2edb9865259b5502e8d 100644 (file)
@@ -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);
index 0d0be67f7209770526d6fa78fafe0fdfd18f9aee..3815cd4323c8d46bcbb6454d40b7b92d6e38da2d 100644 (file)
@@ -188,7 +188,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r,
             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);
index e85b888b7f5b854e3cc0922f4a4d2abff8ea35e3..c1f472cf4f841e4e3d88bd3e6b69137458118eb5 100644 (file)
@@ -829,7 +829,7 @@ static APR_INLINE void do_double_reverse (conn_rec *conn)
     rv = apr_sockaddr_info_get(&sa, conn->remote_host, APR_UNSPEC, 0, 0, conn->pool);
     if (rv == APR_SUCCESS) {
         while (sa) {
-            if (apr_sockaddr_equal(sa, conn->peer_addr)) {
+            if (apr_sockaddr_equal(sa, conn->client_addr)) {
                 conn->double_reverse = 1;
                 return;
             }
@@ -871,7 +871,7 @@ AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config,
         && (type == REMOTE_DOUBLE_REV
         || hostname_lookups != HOSTNAME_LOOKUP_OFF)) {
 
-        if (apr_getnameinfo(&conn->remote_host, conn->peer_addr, 0)
+        if (apr_getnameinfo(&conn->remote_host, conn->client_addr, 0)
             == APR_SUCCESS) {
             ap_str_tolower(conn->remote_host);
 
@@ -910,7 +910,7 @@ AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config,
         }
         else {
             *str_is_ip = 1;
-            return conn->peer_ip;
+            return conn->client_ip;
         }
     }
 }
@@ -4497,7 +4497,7 @@ static conn_rec *core_create_conn(apr_pool_t *ptrans, server_rec *server,
     }
 
     apr_sockaddr_ip_get(&c->local_ip, c->local_addr);
-    if ((rv = apr_socket_addr_get(&c->peer_addr, APR_REMOTE, csd))
+    if ((rv = apr_socket_addr_get(&c->client_addr, APR_REMOTE, csd))
         != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_INFO, rv, server, APLOGNO(00138)
                      "apr_socket_addr_get(APR_REMOTE)");
@@ -4505,7 +4505,7 @@ static conn_rec *core_create_conn(apr_pool_t *ptrans, server_rec *server,
         return NULL;
     }
 
-    apr_sockaddr_ip_get(&c->peer_ip, c->peer_addr);
+    apr_sockaddr_ip_get(&c->client_ip, c->client_addr);
     c->base_server = server;
 
     c->id = id;
index 70c37e0ae7f6553a0e19f1e44103204c204a57f7..de560efce704854bd7c61556fa617b65fc56bee4 100644 (file)
@@ -562,11 +562,11 @@ static int log_remote_address(const ap_errorlog_info *info, const char *arg,
                               char *buf, int buflen)
 {
     if (info->r && !(arg && *arg == 'c'))
-        return apr_snprintf(buf, buflen, "%s:%d", info->r->client_ip,
-                            info->r->client_addr->port);
+        return apr_snprintf(buf, buflen, "%s:%d", info->r->useragent_ip,
+                            info->r->useragent_addr->port);
     else if (info->c)
-        return apr_snprintf(buf, buflen, "%s:%d", info->c->peer_ip,
-                            info->c->peer_addr->port);
+        return apr_snprintf(buf, buflen, "%s:%d", info->c->client_ip,
+                            info->c->client_addr->port);
     else
         return 0;
 }
@@ -962,18 +962,18 @@ static int do_errorlog_default(const ap_errorlog_info *info, char *buf,
     }
 
     /*
-     * client_ip/peer_ip can be client or backend server. If we have a scoreboard
-     * handle, it is likely a client.
+     * useragent_ip/client_ip can be client or backend server. If we have
+     * a scoreboard handle, it is likely a client.
      */
     if (info->r) {
         len += apr_snprintf(buf + len, buflen - len,
                             info->r->connection->sbh ? "[client %s:%d] " : "[remote %s:%d] ",
-                            info->r->client_ip, info->r->client_addr->port);
+                            info->r->useragent_ip, info->r->useragent_addr->port);
     }
     else if (info->c) {
         len += apr_snprintf(buf + len, buflen - len,
                             info->c->sbh ? "[client %s:%d] " : "[remote %s:%d] ",
-                            info->c->peer_ip, info->c->peer_addr->port);
+                            info->c->client_ip, info->c->client_addr->port);
     }
 
     /* the actual error message */
index f44cd21c877744bc3d1c10a9cfeefb9ceb2351d9..733cdaacf3e8e88f07e726e82b5641941f7342a1 100644 (file)
@@ -979,8 +979,8 @@ request_rec *ap_read_request(conn_rec *conn)
      */
     r->used_path_info = AP_REQ_DEFAULT_PATH_INFO;
 
-    r->client_addr = conn->peer_addr;
-    r->client_ip = conn->peer_ip;
+    r->useragent_addr = conn->client_addr;
+    r->useragent_ip = conn->client_ip;
 
     tmp_bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
 
index dae87394bd599f9d4f6c37b11e793c4aec3f44cd..bb2a054de3b73c57ec730b5343326382c8c9fbd5 100644 (file)
@@ -1832,8 +1832,8 @@ static request_rec *make_sub_request(const request_rec *r,
         rnew->output_filters = r->proto_output_filters;
     }
 
-    rnew->client_addr = r->client_addr;
-    rnew->client_ip = r->client_ip;
+    rnew->useragent_addr = r->useragent_addr;
+    rnew->useragent_ip = r->useragent_ip;
 
     /* no input filters for a subrequest */
 
index 3f0460c91147989898d91c53fa814577493d0d62..6c543f54ae4aeb4a57c1752cf5bfbcf3b160434f 100644 (file)
@@ -1208,7 +1208,7 @@ static const char *conn_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
     case 1:
 #if APR_HAVE_IPV6
         {
-            apr_sockaddr_t *addr = c->peer_addr;
+            apr_sockaddr_t *addr = c->client_addr;
             if (addr->family == AF_INET6
                 && !IN6_IS_ADDR_V4MAPPED((struct in6_addr *)addr->ipaddr_ptr))
                 return "on";
@@ -1221,7 +1221,7 @@ static const char *conn_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
     case 2:
         return c->log_id;
     case 3:
-        return c->peer_ip;
+        return c->client_ip;
     default:
         ap_assert(0);
         return NULL;
@@ -1344,7 +1344,7 @@ static const char *request_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
     case 27:
         return r->status ? apr_psprintf(ctx->p, "%d", r->status) : "";
     case 28:
-        return r->client_ip;
+        return r->useragent_ip;
     default:
         ap_assert(0);
         return NULL;
@@ -1493,7 +1493,7 @@ static int op_R(ap_expr_eval_ctx_t *ctx, const void *data, const char *arg1)
     if (!ctx->r)
         return FALSE;
 
-    return apr_ipsubnet_test(subnet, ctx->r->client_addr);
+    return apr_ipsubnet_test(subnet, ctx->r->useragent_addr);
 }
 
 static int op_T(ap_expr_eval_ctx_t *ctx, const void *data, const char *arg)
index 907dd3607992166142880848dea2e19b8bd583ea..38dfa0efbdafcc31935a4161707b4db784012e8f 100644 (file)
@@ -235,7 +235,7 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r)
                   apr_psprintf(r->pool, "%u", ap_get_server_port(r)));
     add_unless_null(e, "REMOTE_HOST",
                     ap_get_remote_host(c, r->per_dir_config, REMOTE_HOST, NULL));
-    apr_table_addn(e, "REMOTE_ADDR", r->client_ip);
+    apr_table_addn(e, "REMOTE_ADDR", r->useragent_ip);
     apr_table_addn(e, "DOCUMENT_ROOT", ap_document_root(r));    /* Apache */
     apr_table_setn(e, "REQUEST_SCHEME", ap_http_scheme(r));
     apr_table_addn(e, "CONTEXT_PREFIX", ap_context_prefix(r));
@@ -243,7 +243,7 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r)
     apr_table_addn(e, "SERVER_ADMIN", s->server_admin); /* Apache */
     apr_table_addn(e, "SCRIPT_FILENAME", r->filename);  /* Apache */
 
-    rport = c->peer_addr->port;
+    rport = c->client_addr->port;
     apr_table_addn(e, "REMOTE_PORT", apr_itoa(r->pool, rport));
 
     if (r->user) {