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

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214003 13f79535-47bb-0310-9956-ffa450edef68

15 files changed:
docs/manual/developer/new_api_2_4.xml
include/httpd.h
modules/aaa/mod_access_compat.c
modules/aaa/mod_authz_host.c
modules/arch/netware/mod_nw_ssl.c
modules/filters/mod_ext_filter.c
modules/http/http_request.c
modules/loggers/mod_log_config.c
modules/mappers/mod_rewrite.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

index 53984834c7cc1d83c77e4f7381d3e665c8cb68ad..869857ae5aa1f6bed7900dd9c942d9be36b256b9 100644 (file)
       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
index a0734dc861ddb851e2d15acc183914c8e5e10445..71211896416bc2abb110f540ef8bd2d0ef462d0d 100644 (file)
@@ -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;
 };
 
 /**
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 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..0f9e76dbb513cb657428ffa68034acd665ab3ce7 100644 (file)
@@ -314,7 +314,7 @@ static const char *log_remote_address(request_rec *r, char *a)
         return r->connection->peer_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 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 aa9ae4e230b36f3a924a9972240de4062a51b42f..1cb671551727d11ca775c2814300bb436eb16717 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 */
@@ -367,8 +367,8 @@ static int remoteip_modify_request(request_rec *r)
             }
         }
 
-        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..7822366c0fae1756a480b900954b4cb7dc943e60 100644 (file)
@@ -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.
@@ -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->peer_ip;
+    rp->useragent_addr = c->peer_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);