mirror of
https://github.com/apache/httpd.git
synced 2025-08-15 23:27:39 +00:00
We have functions that allow us to get the ports from the sockets, so use them
here. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86816 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@ -166,6 +166,7 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r)
|
||||
apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
|
||||
apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
|
||||
int i;
|
||||
apr_uint32_t rport;
|
||||
|
||||
/* use a temporary apr_table_t which we'll overlap onto
|
||||
* r->subprocess_env later
|
||||
@ -256,8 +257,8 @@ 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 */
|
||||
|
||||
apr_table_addn(e, "REMOTE_PORT",
|
||||
apr_psprintf(r->pool, "%d", ntohs(c->remote_addr.sin_port)));
|
||||
apr_get_remote_port(&rport, c->client_socket);
|
||||
apr_table_addn(e, "REMOTE_PORT", apr_psprintf(r->pool, "%d", rport));
|
||||
|
||||
if (r->user) {
|
||||
apr_table_addn(e, "REMOTE_USER", r->user);
|
||||
|
Reference in New Issue
Block a user