From ad489c105b6a03587ccf6227c93039822cf7e4d4 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 14 Dec 2011 00:33:46 +0000 Subject: [PATCH] Further clarify the naming of the entity that originates the request by calling that entity a useragent instead of a client. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214005 13f79535-47bb-0310-9956-ffa450edef68 --- server/log.c | 10 +++++----- server/protocol.c | 4 ++-- server/request.c | 4 ++-- server/util_expr_eval.c | 4 ++-- server/util_script.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/server/log.c b/server/log.c index 70c37e0ae7..bdcf427753 100644 --- a/server/log.c +++ b/server/log.c @@ -562,8 +562,8 @@ 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); @@ -962,13 +962,13 @@ 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/peer_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, diff --git a/server/protocol.c b/server/protocol.c index 3014110a16..b4b3990204 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -976,8 +976,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->peer_addr; + r->useragent_ip = conn->peer_ip; tmp_bb = apr_brigade_create(r->pool, r->connection->bucket_alloc); diff --git a/server/request.c b/server/request.c index dae87394bd..bb2a054de3 100644 --- a/server/request.c +++ b/server/request.c @@ -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 */ diff --git a/server/util_expr_eval.c b/server/util_expr_eval.c index 3f0460c911..b2dc9ab0c8 100644 --- a/server/util_expr_eval.c +++ b/server/util_expr_eval.c @@ -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) diff --git a/server/util_script.c b/server/util_script.c index 907dd36079..2f181ecd5c 100644 --- a/server/util_script.c +++ b/server/util_script.c @@ -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)); -- 2.40.0