]> granicus.if.org Git - apache/commitdiff
We don't really want to fool around with socket structures if we don't have to,
authorDavid Reid <dreid@apache.org>
Fri, 3 Nov 2000 02:17:56 +0000 (02:17 +0000)
committerDavid Reid <dreid@apache.org>
Fri, 3 Nov 2000 02:17:56 +0000 (02:17 +0000)
and in this case we can get the ip address directly from the socket.  This
should mean that if we add more protocol support we don't have to worry about
this.  No doubt this is the first of many such changes...

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

server/connection.c

index c96d146cdf234dbdb1aae126bec38397b3624e91..27812d58d51acc6e4498eadde6508c54d5985296 100644 (file)
@@ -286,16 +286,13 @@ conn_rec *ap_new_connection(apr_pool_t *p, server_rec *server,
 
     conn->pool = p;
     conn->local_addr = *saddr;
-    conn->local_ip = apr_pstrdup(conn->pool,
-                               inet_ntoa(conn->local_addr.sin_addr));
+    apr_get_local_ipaddr(&conn->local_ip, inout);
     conn->base_server = server;
     conn->client = conn_io;
     conn->client_socket = inout;
 
     conn->remote_addr = *remaddr;
-    conn->remote_ip = apr_pstrdup(conn->pool,
-                             inet_ntoa(conn->remote_addr.sin_addr));
-    
+    apr_get_remote_ipaddr(&conn->remote_ip, inout);   
     conn->id = id;
 
     return conn;