]> granicus.if.org Git - apache/commitdiff
We have functions that allow us to get the ports from the sockets, so use them
authorDavid Reid <dreid@apache.org>
Fri, 3 Nov 2000 02:15:50 +0000 (02:15 +0000)
committerDavid Reid <dreid@apache.org>
Fri, 3 Nov 2000 02:15:50 +0000 (02:15 +0000)
here.

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

server/util_script.c

index ee076a12efd059fccdfb063b48a80708b834026c..397340fa309f30adfd270e56914be5285a6fa759 100644 (file)
@@ -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);