Commit 1efa40b9 authored by Graham Leggett's avatar Graham Leggett
Browse files

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
parent e1fac1db
Loading
Loading
Loading
Loading
+5 −5
Changes for server/log.c: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -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,
+2 −2
Changes for server/protocol.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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);

+2 −2
Changes for server/request.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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 */

+2 −2
Changes for server/util_expr_eval.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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)
+1 −1
Changes for server/util_script.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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));