trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrew...@apache.org
Subject svn commit: r959407 - in /trafficserver/traffic/trunk: iocore/cluster/ iocore/net/ libinktomi++/ proxy/ proxy/config/ proxy/http2/ proxy/logging/ proxy/mgmt2/ proxy/mgmt2/cop/
Date Wed, 30 Jun 2010 18:44:59 GMT
Author: andrewhsu
Date: Wed Jun 30 18:44:57 2010
New Revision: 959407

URL: http://svn.apache.org/viewvc?rev=959407&view=rev
Log:
TS-18 revert r953510

Tested: Fedora-13-x86_64

This reverts commit "TS-18 added IPv6 support for incoming requests":
http://svn.apache.org/viewvc?view=rev&rev=r953510

There were conflicts with the following files as a result of commit
r955421, but I believe they were resolved appropriately:

	iocore/net/Connection.cc
	iocore/net/P_Connection.h
	iocore/net/UnixConnection.cc

The reverted changes will be moved to a branch called 'ipv6'.

Modified:
    trafficserver/traffic/trunk/iocore/cluster/ClusterConfig.cc
    trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc
    trafficserver/traffic/trunk/iocore/net/Connection.cc
    trafficserver/traffic/trunk/iocore/net/I_NetProcessor.h
    trafficserver/traffic/trunk/iocore/net/I_NetVConnection.h
    trafficserver/traffic/trunk/iocore/net/P_Connection.h
    trafficserver/traffic/trunk/iocore/net/P_NetAccept.h
    trafficserver/traffic/trunk/iocore/net/P_NetVConnection.h
    trafficserver/traffic/trunk/iocore/net/P_UnixNetProcessor.h
    trafficserver/traffic/trunk/iocore/net/P_UnixNetVConnection.h
    trafficserver/traffic/trunk/iocore/net/UnixConnection.cc
    trafficserver/traffic/trunk/iocore/net/UnixNetAccept.cc
    trafficserver/traffic/trunk/iocore/net/UnixNetProcessor.cc
    trafficserver/traffic/trunk/libinktomi++/ink_inet.cc
    trafficserver/traffic/trunk/libinktomi++/ink_inet.h
    trafficserver/traffic/trunk/proxy/Main.cc
    trafficserver/traffic/trunk/proxy/Main.h
    trafficserver/traffic/trunk/proxy/PluginVC.cc
    trafficserver/traffic/trunk/proxy/PluginVC.h
    trafficserver/traffic/trunk/proxy/config/records.config.in
    trafficserver/traffic/trunk/proxy/http2/HttpProxyServerMain.cc
    trafficserver/traffic/trunk/proxy/http2/HttpSM.cc
    trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
    trafficserver/traffic/trunk/proxy/http2/HttpTransact.h
    trafficserver/traffic/trunk/proxy/logging/Log.cc
    trafficserver/traffic/trunk/proxy/logging/LogAccess.cc
    trafficserver/traffic/trunk/proxy/logging/LogAccess.h
    trafficserver/traffic/trunk/proxy/logging/LogAccessHttp.cc
    trafficserver/traffic/trunk/proxy/logging/LogAccessHttp.h
    trafficserver/traffic/trunk/proxy/logging/LogCollationAccept.cc
    trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.cc
    trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.h
    trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterConfig.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterConfig.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterConfig.cc Wed Jun 30 18:44:57 2010
@@ -104,7 +104,6 @@ ClusterAccept::ClusterAcceptEvent(int ev
           accept_action = 0;
         }
         accept_action = netProcessor.main_accept(this, NO_FD, cluster_port,
-                                                 AF_INET,
                                                  NULL, NULL,
                                                  false, socket_recv_bufsize, socket_send_bufsize, ET_CLUSTER);
         if (!accept_action) {

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc Wed Jun 30 18:44:57 2010
@@ -1386,7 +1386,7 @@ ClusterHandler::dump_write_msg(int res)
   // Debug support for inter cluster message trace
   unsigned char x[4];
   memset(x, 0, sizeof(x));
-  *(uint32 *) & x = (uint32) ((struct sockaddr_in *)&(net_vc->get_remote_addr()))->sin_addr.s_addr;
+  *(uint32 *) & x = (uint32) net_vc->get_remote_addr().sin_addr.s_addr;
 
   fprintf(stderr,
           "[W] %u.%u.%u.%u SeqNo=%d, Cnt=%d, CntlCnt=%d Todo=%d, Res=%d\n",
@@ -1405,7 +1405,7 @@ ClusterHandler::dump_read_msg()
   // Debug support for inter cluster message trace
   unsigned char x[4];
   memset(x, 0, sizeof(x));
-  *(uint32 *) & x = (uint32) ((struct sockaddr_in *)&(net_vc->get_remote_addr()))->sin_addr.s_addr;
+  *(uint32 *) & x = (uint32) net_vc->get_remote_addr().sin_addr.s_addr;
 
   fprintf(stderr, "[R] %u.%u.%u.%u  SeqNo=%d, Cnt=%d, CntlCnt=%d\n",
           x[0], x[1], x[2], x[3], read.sequence_number, read.msg.count, read.msg.control_bytes);

Modified: trafficserver/traffic/trunk/iocore/net/Connection.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/Connection.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/Connection.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/Connection.cc Wed Jun 30 18:44:57 2010
@@ -69,7 +69,7 @@ Connection::Connection()
   , is_bound(false)
   , is_connected(false)
 {
-  memset(&sa, 0, sizeof(struct sockaddr_storage));
+  memset(&sa, 0, sizeof(struct sockaddr_in));
 }
 
 
@@ -223,35 +223,12 @@ Lerror:
 
 
 int
-Server::listen(int port_number, int domain, bool non_blocking, int recv_bufsize, int send_bufsize)
+Server::listen(int port_number, bool non_blocking, int recv_bufsize, int send_bufsize)
 {
   ink_assert(fd == NO_FD);
   int res = 0;
 
-  char port[6];
-  struct addrinfo hints;
-  struct addrinfo *ai_res = NULL;
-  struct addrinfo *ai;
-  snprintf(port, sizeof(port), "%d", port_number);
-
-  memset(&hints, 0, sizeof(hints));
-  hints.ai_family = domain;
-  hints.ai_socktype = SOCK_STREAM;
-  hints.ai_flags = AI_PASSIVE|AI_NUMERICHOST;
-
-  if(getaddrinfo(accept_ip_str, port, &hints, &ai_res) != 0) {
-    return -1;
-  }
-
-  ai = ai_res;
-
-  res = socketManager.socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
-
-  memset(&sa, 0, sizeof(sa));
-  memcpy(&sa, ai->ai_addr, ai->ai_addrlen);
-
-  freeaddrinfo(ai_res);
-
+  res = socketManager.socket(AF_INET, SOCK_STREAM, 0);
   if (res < 0)
     return res;
   fd = res;
@@ -302,6 +279,13 @@ Server::listen(int port_number, int doma
     goto Lerror;
 #endif
 
+  memset(&sa, 0, sizeof(sa));
+  //
+  // Accept_ip should already be in network byte order..
+  //
+  sa.sin_addr.s_addr = accept_ip;
+  sa.sin_port = htons(port_number);
+  sa.sin_family = AF_INET;
 
 #ifdef SET_NO_LINGER
   {
@@ -313,9 +297,6 @@ Server::listen(int port_number, int doma
   }
 #endif
 
-  if (domain == AF_INET6 && (res = safe_setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, ON, sizeof(int))) < 0)
-    goto Lerror;
-
   if ((res = safe_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, ON, sizeof(int))) < 0)
     goto Lerror;
 

Modified: trafficserver/traffic/trunk/iocore/net/I_NetProcessor.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/I_NetProcessor.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/I_NetProcessor.h (original)
+++ trafficserver/traffic/trunk/iocore/net/I_NetProcessor.h Wed Jun 30 18:44:57 2010
@@ -60,12 +60,10 @@ public:
       continuation is not locked on callbacks and so the handler must
       be re-entrant.
     @param port port to bind for accept.
-    @param domain communication domain
     @param frequent_accept if true, accept is done on all event
       threads and throttle limit is imposed if false, accept is done
       just on one thread and no throttling is done.
     @param accept_ip DEPRECATED.
-    @param accept_ip_str for IPv6 Address
     @param callback_on_open if true, cont is called back with
       NET_EVENT_ACCEPT_SUCCEED, or NET_EVENT_ACCEPT_FAILED on success
       and failure resp.
@@ -86,9 +84,9 @@ public:
       port becomes free immediately.
 
   */
-  inkcoreapi virtual Action * accept(Continuation * cont, int port, int domain = AF_INET, bool frequent_accept = false,       // UNIX only ??
+  inkcoreapi virtual Action * accept(Continuation * cont, int port, bool frequent_accept = false,       // UNIX only ??
                                      // not used
-                                     unsigned int accept_ip = INADDR_ANY, char *accept_ip_str = NULL, bool callback_on_open = false,        // TBD for NT
+                                     unsigned int accept_ip = INADDR_ANY, bool callback_on_open = false,        // TBD for NT
                                      SOCKET listen_socket_in = NO_FD,   // NT only
                                      int accept_pool_size = ACCEPTEX_POOL_SIZE, // NT only
                                      bool accept_only = false,
@@ -117,7 +115,6 @@ public:
       be re-entrant.
     @param listen_socket_in if passed, used for listening.
     @param port port to bind for accept.
-    @param domain communication domain
     @param bound_sockaddr returns the sockaddr for the listen fd.
     @param bound_sockaddr_size size of the sockaddr returned.
     @param accept_only can be used to customize accept, accept a
@@ -136,7 +133,7 @@ public:
       port becomes free immediately.
 
   */
-  virtual Action *main_accept(Continuation * cont, SOCKET listen_socket_in, int port, int domain = AF_INET, sockaddr * bound_sockaddr = NULL, int *bound_sockaddr_size = NULL, bool accept_only = false, int recv_bufsize = 0, int send_bufsize = 0, unsigned long sockopt_flag = 0, EventType etype = ET_NET, bool callback_on_open = false  // TBD for NT
+  virtual Action *main_accept(Continuation * cont, SOCKET listen_socket_in, int port, sockaddr * bound_sockaddr = NULL, int *bound_sockaddr_size = NULL, bool accept_only = false, int recv_bufsize = 0, int send_bufsize = 0, unsigned long sockopt_flag = 0, EventType etype = ET_NET, bool callback_on_open = false  // TBD for NT
     );
 
   /**

Modified: trafficserver/traffic/trunk/iocore/net/I_NetVConnection.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/I_NetVConnection.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/I_NetVConnection.h (original)
+++ trafficserver/traffic/trunk/iocore/net/I_NetVConnection.h Wed Jun 30 18:44:57 2010
@@ -373,8 +373,8 @@ public:
   /** @return current inactivity_timeout value in nanosecs */
   virtual ink_hrtime get_inactivity_timeout() = 0;
 
-  /** Returns local sockaddr storage. */
-  const struct sockaddr_storage &get_local_addr();
+  /** Returns local sockaddr in. */
+  const struct sockaddr_in &get_local_addr();
 
   /** Returns local ip. */
   unsigned int get_local_ip();
@@ -382,8 +382,8 @@ public:
   /** Returns local port. */
   int get_local_port();
 
-  /** Returns remote sockaddr storage. */
-  const struct sockaddr_storage &get_remote_addr();
+  /** Returns remote sockaddr in. */
+  const struct sockaddr_in &get_remote_addr();
 
   /** Returns remote ip. */
   unsigned int get_remote_ip();
@@ -497,8 +497,8 @@ private:
   NetVConnection & operator =(const NetVConnection &);
 
 protected:
-  struct sockaddr_storage local_addr;
-  struct sockaddr_storage remote_addr;
+  struct sockaddr_in local_addr;
+  struct sockaddr_in remote_addr;
 
   int got_local_addr;
   int got_remote_addr;

Modified: trafficserver/traffic/trunk/iocore/net/P_Connection.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/P_Connection.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/P_Connection.h (original)
+++ trafficserver/traffic/trunk/iocore/net/P_Connection.h Wed Jun 30 18:44:57 2010
@@ -81,7 +81,7 @@ struct NetVCOptions;
 struct Connection
 {
   SOCKET fd; ///< Socket for connection.
-  struct sockaddr_storage sa; ///< Remote address.
+  struct sockaddr_in sa; ///< Remote address.
   bool is_bound; ///< Flag for already bound to a local address.
   bool is_connected; ///< Flag for already connected.
 
@@ -124,7 +124,7 @@ struct Connection
 		 uint16 port ///< Remote port.
 	     ) {
     sockaddr_in* sa_in = reinterpret_cast<sockaddr_in*>(&sa);
-    sa.ss_family = AF_INET;
+    sa.sin_family = AF_INET;
     sa_in->sin_port = htons(port);
     sa_in->sin_addr.s_addr = addr;
     memset(&(sa_in->sin_zero), 0, 8);
@@ -161,7 +161,6 @@ struct Server:Connection
   // IP address in network byte order
   //
   unsigned int accept_ip;
-  char *accept_ip_str;
 
   //
   // Use this call for the main proxy accept
@@ -176,7 +175,7 @@ struct Server:Connection
   // converted into network byte order
   //
 
-  int listen(int port, int domain = AF_INET, bool non_blocking = false, int recv_bufsize = 0, int send_bufsize = 0);
+  int listen(int port, bool non_blocking = false, int recv_bufsize = 0, int send_bufsize = 0);
   int setup_fd_for_listen(bool non_blocking = false, int recv_bufsize = 0, int send_bufsize = 0);
 
   Server():Connection(), accept_ip(INADDR_ANY) { }

Modified: trafficserver/traffic/trunk/iocore/net/P_NetAccept.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/P_NetAccept.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/P_NetAccept.h (original)
+++ trafficserver/traffic/trunk/iocore/net/P_NetAccept.h Wed Jun 30 18:44:57 2010
@@ -84,7 +84,6 @@ struct NetAcceptAction:public Action, Re
 struct NetAccept:Continuation
 {
   int port;
-  int domain;
   ink_hrtime period;
   Server server;
   void *alloc_cache;

Modified: trafficserver/traffic/trunk/iocore/net/P_NetVConnection.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/P_NetVConnection.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/P_NetVConnection.h (original)
+++ trafficserver/traffic/trunk/iocore/net/P_NetVConnection.h Wed Jun 30 18:44:57 2010
@@ -23,7 +23,7 @@
 
 #include "I_NetVConnection.h"
 
-TS_INLINE const struct sockaddr_storage &
+TS_INLINE const struct sockaddr_in &
 NetVConnection::get_remote_addr()
 {
   if (!got_remote_addr) {
@@ -36,43 +36,23 @@ NetVConnection::get_remote_addr()
 TS_INLINE unsigned int
 NetVConnection::get_remote_ip()
 {
-  switch (get_remote_addr().ss_family) {
-  case AF_INET:
-    return (unsigned int)((struct sockaddr_in *)&(get_remote_addr()))->sin_addr.s_addr;
-  default:
-    return 0;
-  }
+  return (unsigned int) get_remote_addr().sin_addr.s_addr;
 }
 
 
 TS_INLINE int
 NetVConnection::get_remote_port()
 {
-  switch (get_remote_addr().ss_family) {
-  case AF_INET:
-    return ntohs(((struct sockaddr_in *)&(get_remote_addr()))->sin_port);
-  case AF_INET6:
-    return ntohs(((struct sockaddr_in6 *)&(get_remote_addr()))->sin6_port);
-  default:
-    return 0;
-  }
+  return ntohs(get_remote_addr().sin_port);
 }
 
-TS_INLINE const struct sockaddr_storage &
+TS_INLINE const struct sockaddr_in &
 NetVConnection::get_local_addr()
 {
   if (!got_local_addr) {
     set_local_addr();
-    switch (local_addr.ss_family) {
-    case AF_INET:
-      if (((struct sockaddr_in *)&(local_addr))->sin_addr.s_addr || ((struct sockaddr_in *)&(local_addr))->sin_port) {
-        got_local_addr = 1;
-      }
-      break;
-    case AF_INET6:
-      if (((struct sockaddr_in6 *)&(local_addr))->sin6_addr.s6_addr || ((struct sockaddr_in6 *)&(local_addr))->sin6_port) {
-        got_local_addr = 1;
-      }
+    if (local_addr.sin_addr.s_addr || local_addr.sin_port) {
+      got_local_addr = 1;
     }
   }
   return local_addr;
@@ -81,23 +61,11 @@ NetVConnection::get_local_addr()
 TS_INLINE unsigned int
 NetVConnection::get_local_ip()
 {
-  switch (get_local_addr().ss_family) {
-  case AF_INET:
-    return (unsigned int)((struct sockaddr_in *)&(get_local_addr()))->sin_addr.s_addr;
-  default:
-    return 0;
-  }
+  return (unsigned int) get_local_addr().sin_addr.s_addr;
 }
 
 TS_INLINE int
 NetVConnection::get_local_port()
 {
-  switch (get_local_addr().ss_family) {
-  case AF_INET:
-    return ntohs(((struct sockaddr_in *)&(get_local_addr()))->sin_port);
-  case AF_INET6:
-    return ntohs(((struct sockaddr_in6 *)&(get_local_addr()))->sin6_port);
-  default:
-    return 0;
-  }
+  return ntohs(get_local_addr().sin_port);
 }

Modified: trafficserver/traffic/trunk/iocore/net/P_UnixNetProcessor.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/P_UnixNetProcessor.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/P_UnixNetProcessor.h (original)
+++ trafficserver/traffic/trunk/iocore/net/P_UnixNetProcessor.h Wed Jun 30 18:44:57 2010
@@ -40,7 +40,6 @@ public:
   virtual Action * accept_internal(Continuation * cont,
                                    int fd,
                                    int port,
-                                   int domain,
                                    sockaddr * bound_sockaddr = NULL,
                                    int *bound_sockaddr_size = NULL,
                                    bool frequent_accept = true,
@@ -49,7 +48,6 @@ public:
                                    int send_bufsize = 0,
                                    unsigned long sockopt_flags = 0,
                                    unsigned int accept_ip = INADDR_ANY,
-                                   char *accept_ip_str = NULL,
                                    bool callback_on_open = false, EventType etype = ET_NET);
 
 

Modified: trafficserver/traffic/trunk/iocore/net/P_UnixNetVConnection.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/P_UnixNetVConnection.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/P_UnixNetVConnection.h (original)
+++ trafficserver/traffic/trunk/iocore/net/P_UnixNetVConnection.h Wed Jun 30 18:44:57 2010
@@ -256,7 +256,9 @@ typedef int (UnixNetVConnection::*NetVCo
 TS_INLINE void
 UnixNetVConnection::set_remote_addr()
 {
-  remote_addr = con.sa;
+  remote_addr.sin_family = con.sa.sin_family;
+  remote_addr.sin_port = htons(port);
+  remote_addr.sin_addr.s_addr = ip;
 }
 
 TS_INLINE void

Modified: trafficserver/traffic/trunk/iocore/net/UnixConnection.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/UnixConnection.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/UnixConnection.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/UnixConnection.cc Wed Jun 30 18:44:57 2010
@@ -72,10 +72,10 @@ Connection::setup_mc_send(unsigned int m
     goto Lerror;
   }
 
-  sa.ss_family = AF_INET;
-  ((struct sockaddr_in *)(&sa))->sin_port = htons(mc_port);
-  ((struct sockaddr_in *)(&sa))->sin_addr.s_addr = mc_ip;
-  memset(&(((struct sockaddr_in *)(&sa))->sin_zero), 0, 8);
+  sa.sin_family = AF_INET;
+  sa.sin_port = htons(mc_port);
+  sa.sin_addr.s_addr = mc_ip;
+  memset(&sa.sin_zero, 0, 8);
 
 #ifdef SET_CLOSE_ON_EXEC
   if ((res = safe_fcntl(fd, F_SETFD, 1)) < 0)
@@ -131,9 +131,9 @@ Connection::setup_mc_receive(unsigned in
     goto Lerror;
 
   memset(&sa, 0, sizeof(sa));
-  sa.ss_family = AF_INET;
-  ((struct sockaddr_in *)(&sa))->sin_addr.s_addr = mc_ip;
-  ((struct sockaddr_in *)(&sa))->sin_port = htons(mc_port);
+  sa.sin_family = AF_INET;
+  sa.sin_addr.s_addr = mc_ip;
+  sa.sin_port = htons(mc_port);
 
   if ((res = socketManager.ink_bind(fd, (struct sockaddr *) &sa, sizeof(sa), IPPROTO_TCP)) < 0)
     goto Lerror;

Modified: trafficserver/traffic/trunk/iocore/net/UnixNetAccept.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/UnixNetAccept.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/UnixNetAccept.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/UnixNetAccept.cc Wed Jun 30 18:44:57 2010
@@ -119,9 +119,9 @@ net_accept(NetAccept * na, void *ep, boo
     na->alloc_cache = NULL;
 
     vc->submit_time = ink_get_hrtime();
-    vc->ip = ((struct sockaddr_in *)(&(vc->con.sa)))->sin_addr.s_addr;
-    vc->port = ntohs(((struct sockaddr_in *)(&(vc->con.sa)))->sin_port);
-    vc->accept_port = ntohs(((struct sockaddr_in *)(&(na->server.sa)))->sin_port);
+    vc->ip = vc->con.sa.sin_addr.s_addr;
+    vc->port = ntohs(vc->con.sa.sin_port);
+    vc->accept_port = ntohs(na->server.sa.sin_port);
     vc->mutex = new_ProxyMutex();
     vc->action_ = *na->action_;
     vc->closed  = 0;
@@ -268,7 +268,7 @@ NetAccept::do_listen(bool non_blocking)
     }
   } else {
   Lretry:
-    if ((res = server.listen(port, domain, non_blocking, recv_bufsize, send_bufsize)))
+    if ((res = server.listen(port, non_blocking, recv_bufsize, send_bufsize)))
       Warning("unable to listen on port %d: %d %d, %s", port, res, errno, strerror(errno));
   }
   if (callback_on_open && !action_->cancelled) {
@@ -332,9 +332,9 @@ NetAccept::do_blocking_accept(NetAccept 
 
     RecIncrGlobalRawStatSum(net_rsb, net_connections_currently_open_stat, 1);
     vc->submit_time = now;
-    vc->ip = ((struct sockaddr_in *)(&(vc->con.sa)))->sin_addr.s_addr;
-    vc->port = ntohs(((struct sockaddr_in *)(&(vc->con.sa)))->sin_port);
-    vc->accept_port = ntohs(((struct sockaddr_in *)(&(server.sa)))->sin_port);
+    vc->ip = vc->con.sa.sin_addr.s_addr;
+    vc->port = ntohs(vc->con.sa.sin_port);
+    vc->accept_port = ntohs(server.sa.sin_port);
     vc->mutex = new_ProxyMutex();
     vc->action_ = *action_;
     SET_CONTINUATION_HANDLER(vc, (NetVConnHandler) & UnixNetVConnection::acceptEvent);
@@ -374,8 +374,8 @@ NetAccept::acceptEvent(int event, void *
       if ((res = accept_fn(this, e, false)) < 0) {
         NET_DECREMENT_DYN_STAT(net_accepts_currently_open_stat);
         /* INKqa11179 */
-        Warning("Accept on port %d failed with error no %d", ntohs(((struct sockaddr_in *)(&(server.sa)))->sin_port), res);
-        Warning("Traffic Server may be unable to accept more network" "connections on %d", ntohs(((struct sockaddr_in *)(&(server.sa)))->sin_port));
+        Warning("Accept on port %d failed with error no %d", ntohs(server.sa.sin_port), res);
+        Warning("Traffic Server may be unable to accept more network" "connections on %d", ntohs(server.sa.sin_port));
         e->cancel();
         delete this;
         return EVENT_DONE;
@@ -474,9 +474,9 @@ NetAccept::acceptFastEvent(int event, vo
     vc->id = net_next_connection_number();
 
     vc->submit_time = ink_get_hrtime();
-    vc->ip = ((struct sockaddr_in *)(&(vc->con.sa)))->sin_addr.s_addr;
-    vc->port = ntohs(((struct sockaddr_in *)(&(vc->con.sa)))->sin_port);
-    vc->accept_port = ntohs(((struct sockaddr_in *)(&(server.sa)))->sin_port);
+    vc->ip = vc->con.sa.sin_addr.s_addr;
+    vc->port = ntohs(vc->con.sa.sin_port);
+    vc->accept_port = ntohs(server.sa.sin_port);
     vc->mutex = new_ProxyMutex();
     vc->thread = e->ethread;
 

Modified: trafficserver/traffic/trunk/iocore/net/UnixNetProcessor.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/UnixNetProcessor.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/UnixNetProcessor.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/UnixNetProcessor.cc Wed Jun 30 18:44:57 2010
@@ -47,10 +47,8 @@ net_next_connection_number()
 Action *
 NetProcessor::accept(Continuation * cont,
                      int port,
-                     int domain,
                      bool frequent_accept,
                      unsigned int accept_ip,
-                     char *accept_ip_str,
                      bool callback_on_open,
                      SOCKET listen_socket_in,
                      int accept_pool_size,
@@ -66,17 +64,17 @@ NetProcessor::accept(Continuation * cont
   (void) bound_sockaddr_size;   // NT only
   NetDebug("iocore_net_processor", "NetProcessor::accept - port %d,recv_bufsize %d, send_bufsize %d, sockopt 0x%0lX",
         port, recv_bufsize, send_bufsize, sockopt_flags);
-  return ((UnixNetProcessor *) this)->accept_internal(cont, NO_FD, port, domain,
+  return ((UnixNetProcessor *) this)->accept_internal(cont, NO_FD, port,
                                                       bound_sockaddr,
                                                       bound_sockaddr_size,
                                                       frequent_accept,
                                                       net_accept,
                                                       recv_bufsize, send_bufsize, sockopt_flags,
-                                                      accept_ip, accept_ip_str, callback_on_open, etype);
+                                                      accept_ip, callback_on_open, etype);
 }
 
 Action *
-NetProcessor::main_accept(Continuation * cont, SOCKET fd, int port, int domain,
+NetProcessor::main_accept(Continuation * cont, SOCKET fd, int port,
                           sockaddr * bound_sockaddr, int *bound_sockaddr_size,
                           bool accept_only,
                           int recv_bufsize, int send_bufsize, unsigned long sockopt_flags,
@@ -85,7 +83,7 @@ NetProcessor::main_accept(Continuation *
   (void) accept_only;           // NT only
   NetDebug("iocore_net_processor", "NetProcessor::main_accept - port %d,recv_bufsize %d, send_bufsize %d, sockopt 0x%0lX",
         port, recv_bufsize, send_bufsize, sockopt_flags);
-  return ((UnixNetProcessor *) this)->accept_internal(cont, fd, port, domain,
+  return ((UnixNetProcessor *) this)->accept_internal(cont, fd, port,
                                                       bound_sockaddr,
                                                       bound_sockaddr_size,
                                                       true,
@@ -94,7 +92,6 @@ NetProcessor::main_accept(Continuation *
                                                       send_bufsize,
                                                       sockopt_flags,
                                                       ((UnixNetProcessor *) this)->incoming_ip_to_bind_saddr,
-                                                      ((UnixNetProcessor *) this)->incoming_ip_to_bind,
                                                       callback_on_open, etype);
 }
 
@@ -104,7 +101,6 @@ Action *
 UnixNetProcessor::accept_internal(Continuation * cont,
                                   int fd,
                                   int port,
-                                  int domain,
                                   struct sockaddr * bound_sockaddr,
                                   int *bound_sockaddr_size,
                                   bool frequent_accept,
@@ -112,7 +108,7 @@ UnixNetProcessor::accept_internal(Contin
                                   int recv_bufsize,
                                   int send_bufsize,
                                   unsigned long sockopt_flags,
-                                  unsigned int accept_ip, char *accept_ip_str, bool callback_on_open, EventType etype)
+                                  unsigned int accept_ip, bool callback_on_open, EventType etype)
 {
   setEtype(etype);
   NetAccept *na = createNetAccept();
@@ -121,11 +117,9 @@ UnixNetProcessor::accept_internal(Contin
   ProxyMutex *mutex = thread->mutex;
   NET_INCREMENT_DYN_STAT(net_accepts_currently_open_stat);
   na->port = port;
-  na->domain = domain;
   na->accept_fn = fn;
   na->server.fd = fd;
   na->server.accept_ip = accept_ip;
-  na->server.accept_ip_str = accept_ip_str;
   na->action_ = NEW(new NetAcceptAction());
   *na->action_ = cont;
   na->action_->server = &na->server;

Modified: trafficserver/traffic/trunk/libinktomi++/ink_inet.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/libinktomi%2B%2B/ink_inet.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/libinktomi++/ink_inet.cc (original)
+++ trafficserver/traffic/trunk/libinktomi++/ink_inet.cc Wed Jun 30 18:44:57 2010
@@ -162,35 +162,3 @@ ink_inet_addr(const char *s)
   }
   return htonl((uint32) - 1);
 }
-
-const char *ink_inet_ntop(const struct sockaddr *addr, char *dst, size_t size)
-{
-  void *address = NULL;
-
-  switch (addr->sa_family) {
-  case AF_INET:
-    address = &((struct sockaddr_in *)addr)->sin_addr;
-    break;
-  case AF_INET6:
-    address = &((struct sockaddr_in6 *)addr)->sin6_addr;
-    break;
-  }
-
-  return inet_ntop(addr->sa_family, address, dst, size);
-}
-
-uint16_t ink_inet_port(const struct sockaddr *addr)
-{
-  uint16_t port = 0;
-
-  switch (addr->sa_family) {
-  case AF_INET:
-    port = ntohs(((struct sockaddr_in *)addr)->sin_port);
-    break;
-  case AF_INET6:
-    port = ntohs(((struct sockaddr_in6 *)addr)->sin6_port);
-    break;
-  }
-
-  return port;
-}

Modified: trafficserver/traffic/trunk/libinktomi++/ink_inet.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/libinktomi%2B%2B/ink_inet.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/libinktomi++/ink_inet.h (original)
+++ trafficserver/traffic/trunk/libinktomi++/ink_inet.h Wed Jun 30 18:44:57 2010
@@ -88,7 +88,4 @@ struct hostent *ink_gethostbyaddr_r(char
 */
 inkcoreapi uint32 ink_inet_addr(const char *s);
 
-const char *ink_inet_ntop(const struct sockaddr *addr, char *dst, size_t size);
-uint16_t ink_inet_port(const struct sockaddr *addr);
-
 #endif // _ink_inet.h

Modified: trafficserver/traffic/trunk/proxy/Main.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Main.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Main.cc (original)
+++ trafficserver/traffic/trunk/proxy/Main.cc Wed Jun 30 18:44:57 2010
@@ -1044,8 +1044,8 @@ parse_accept_fd_list()
     if (attr_str == NULL) {
       attr = SERVER_PORT_DEFAULT;
     } else {
-      if (strlen(attr_str) > 2) {
-        Warning("too many port attribute fields (more than 2) '%s'", attr);
+      if (strlen(attr_str) > 1) {
+        Warning("too many port attribute fields (more than 1) '%s'", attr);
         attr = SERVER_PORT_DEFAULT;
       } else {
         switch (*attr_str) {

Modified: trafficserver/traffic/trunk/proxy/Main.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Main.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Main.h (original)
+++ trafficserver/traffic/trunk/proxy/Main.h Wed Jun 30 18:44:57 2010
@@ -124,7 +124,6 @@ extern AppVersionInfo appVersionInfo;
 struct HttpOtherPortEntry
 {
   int port;
-  int domain;
   HttpPortTypes type;
 };
 extern HttpOtherPortEntry *http_other_port_array;

Modified: trafficserver/traffic/trunk/proxy/PluginVC.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/PluginVC.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/PluginVC.cc (original)
+++ trafficserver/traffic/trunk/proxy/PluginVC.cc Wed Jun 30 18:44:57 2010
@@ -1122,15 +1122,15 @@ PluginVCCore::kill_no_connect()
 void
 PluginVCCore::set_passive_addr(uint32 ip, int port)
 {
-  ((struct sockaddr_in *)&(passive_addr_struct))->sin_addr.s_addr = htonl(ip);
-  ((struct sockaddr_in *)&(passive_addr_struct))->sin_port = htons(port);
+  passive_addr_struct.sin_addr.s_addr = htonl(ip);
+  passive_addr_struct.sin_port = htons(port);
 }
 
 void
 PluginVCCore::set_active_addr(uint32 ip, int port)
 {
-  ((struct sockaddr_in *)&(active_addr_struct))->sin_addr.s_addr = htonl(ip);
-  ((struct sockaddr_in *)&(active_addr_struct))->sin_port = htons(port);
+  active_addr_struct.sin_addr.s_addr = htonl(ip);
+  active_addr_struct.sin_port = htons(port);
 }
 
 void

Modified: trafficserver/traffic/trunk/proxy/PluginVC.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/PluginVC.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/PluginVC.h (original)
+++ trafficserver/traffic/trunk/proxy/PluginVC.h Wed Jun 30 18:44:57 2010
@@ -200,8 +200,8 @@ private:
   MIOBuffer *a_to_p_buffer;
   IOBufferReader *a_to_p_reader;
 
-  struct sockaddr_storage passive_addr_struct;
-  struct sockaddr_storage active_addr_struct;
+  struct sockaddr_in passive_addr_struct;
+  struct sockaddr_in active_addr_struct;
 
   void *passive_data;
   void *active_data;

Modified: trafficserver/traffic/trunk/proxy/config/records.config.in
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/config/records.config.in?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/config/records.config.in (original)
+++ trafficserver/traffic/trunk/proxy/config/records.config.in Wed Jun 30 18:44:57 2010
@@ -104,8 +104,6 @@ CONFIG proxy.config.alarm.abs_path STRIN
    # server_other_ports STRING 1234:X 12345:X
 CONFIG proxy.config.http.server_port INT 8080
 CONFIG proxy.config.http.server_port_attr STRING X
-# to enable IPv6 listening on port 8080:
-# CONFIG proxy.config.http.server_other_ports STRING 8080:X6
 CONFIG proxy.config.http.server_other_ports STRING NULL
 CONFIG proxy.config.http.ssl_ports STRING 443 563
 CONFIG proxy.config.http.insert_request_via_str INT 1

Modified: trafficserver/traffic/trunk/proxy/http2/HttpProxyServerMain.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpProxyServerMain.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpProxyServerMain.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpProxyServerMain.cc Wed Jun 30 18:44:57 2010
@@ -81,49 +81,34 @@ struct DumpStats:Continuation
   }
 };
 
-
-typedef struct _Attributes {
-  HttpPortTypes type;
-  int domain;
-
-  _Attributes() : type(SERVER_PORT_DEFAULT), domain(AF_INET) {}
-}
-Attributes;
-
-void get_connection_attributes(const char *attr, Attributes *result) {
-  int attr_len;
-
-  result->type = SERVER_PORT_DEFAULT;
-  result->domain = AF_INET;
-
-  if (!attr ) return;
-
-  attr_len = strlen(attr);
-
-  if (attr_len > 2) {
-    Warning("too many port attributes: '%s'", attr);
-    return;
-  } else if (attr_len <= 0) {
-    return;
-  }
-
-  switch (*attr) {
-  case 'C': result->type = SERVER_PORT_COMPRESSED; break;
-  case 'X': result->type = SERVER_PORT_DEFAULT; break;
-  case 'T': result->type = SERVER_PORT_BLIND_TUNNEL; break;
-  default: Warning("unknown port attribute '%s'", attr); break;
-  }
-
-  if (attr_len >= 2) {
-    switch (*(attr + 1)) {
-    case '6': result->domain = AF_INET6; break;
-    default: result->domain = AF_INET;
+HttpPortTypes
+get_connection_attributes(char *attr)
+{
+  HttpPortTypes attributes = SERVER_PORT_DEFAULT;
+  if (attr) {
+    if (strlen(attr) > 1) {
+      Warning("too many port attributes: '%s'", attr);
+    } else {
+      switch (*attr) {
+      case 'C':
+        attributes = SERVER_PORT_COMPRESSED;
+        break;
+      case 'X':
+        attributes = SERVER_PORT_DEFAULT;
+        break;
+      case 'T':
+        attributes = SERVER_PORT_BLIND_TUNNEL;
+        break;
+      default:
+        Warning("unknown port attribute '%s'", attr);
+        break;
+      }
     }
   }
-
-  return;
+  return attributes;
 }
 
+
 static HttpOtherPortEntry *
 parse_http_server_other_ports()
 {
@@ -169,11 +154,7 @@ parse_http_server_other_ports()
     }
 
     additional_ports_array[accept_index].port = port;
-
-    Attributes attr;
-    get_connection_attributes(attr_str, &attr);
-    additional_ports_array[accept_index].type = attr.type;
-    additional_ports_array[accept_index].domain = attr.domain;
+    additional_ports_array[accept_index].type = get_connection_attributes(attr_str);
 
     accept_index++;
   }
@@ -261,8 +242,7 @@ start_HttpProxyServer(int fd, int port, 
   int sock_send_buffer_size_in = 0;
   unsigned long sock_option_flag_in = 0;
   char *attr_string = 0;
-  static HttpPortTypes type = SERVER_PORT_DEFAULT;
-  static int domain = AF_INET;
+  static HttpPortTypes attr = SERVER_PORT_DEFAULT;
 
   if (!called_once) {
     // function can be called several times : do memory allocation once
@@ -281,10 +261,7 @@ start_HttpProxyServer(int fd, int port, 
     // end of deprecated config options
 
     if (attr_string) {
-      Attributes attr;
-      get_connection_attributes(attr_string, &attr);
-      type = attr.type;
-      domain = attr.domain;
+      attr = get_connection_attributes(attr_string);
       xfree(attr_string);
     }
     called_once = true;
@@ -292,7 +269,7 @@ start_HttpProxyServer(int fd, int port, 
       for (int i = 0; http_port_attr_array[i].fd != NO_FD; i++) {
         HttpPortEntry & e = http_port_attr_array[i];
         if (e.fd)
-          netProcessor.main_accept(NEW(new HttpAccept(e.type)), e.fd, 0, AF_INET, NULL, NULL, false,
+          netProcessor.main_accept(NEW(new HttpAccept(e.type)), e.fd, 0, NULL, NULL, false,
                                    sock_recv_buffer_size_in, sock_send_buffer_size_in, sock_option_flag_in);
       }
     } else {
@@ -302,7 +279,7 @@ start_HttpProxyServer(int fd, int port, 
     }
   }
   if (!http_port_attr_array) {
-    netProcessor.main_accept(NEW(new HttpAccept(type)), fd, port, domain, NULL, NULL, false,
+    netProcessor.main_accept(NEW(new HttpAccept(attr)), fd, port, NULL, NULL, false,
                              sock_recv_buffer_size_in, sock_send_buffer_size_in, sock_option_flag_in);
 
     if (http_other_port_array) {
@@ -311,7 +288,7 @@ start_HttpProxyServer(int fd, int port, 
         if ((e.port<1) || (e.port> 65535))
           Warning("additional port out of range ignored: %d", e.port);
         else
-          netProcessor.main_accept(NEW(new HttpAccept(e.type)), fd, e.port, e.domain, NULL, NULL, false,
+          netProcessor.main_accept(NEW(new HttpAccept(e.type)), fd, e.port, NULL, NULL, false,
                                    sock_recv_buffer_size_in, sock_send_buffer_size_in, sock_option_flag_in);
       }
     }
@@ -319,7 +296,7 @@ start_HttpProxyServer(int fd, int port, 
     for (int i = 0; http_port_attr_array[i].fd != NO_FD; i++) {
       HttpPortEntry & e = http_port_attr_array[i];
       if (!e.fd) {
-        netProcessor.main_accept(NEW(new HttpAccept(type)), fd, port, domain, NULL, NULL, false,
+        netProcessor.main_accept(NEW(new HttpAccept(attr)), fd, port, NULL, NULL, false,
                                  sock_recv_buffer_size_in, sock_send_buffer_size_in, sock_option_flag_in);
       }
     }

Modified: trafficserver/traffic/trunk/proxy/http2/HttpSM.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpSM.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpSM.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpSM.cc Wed Jun 30 18:44:57 2010
@@ -639,8 +639,6 @@ HttpSM::attach_client_session(HttpClient
   t_state.client_info.port = client_vc->get_netvc()->get_local_port();
   t_state.backdoor_request = client_vc->backdoor_connect;
 
-  memset(&(t_state.client_info.addr), 0, sizeof(t_state.client_info.addr));
-  t_state.client_info.addr = client_vc->get_netvc()->get_remote_addr();
 
   t_state.client_info.port_attribute = (HttpPortTypes) client_vc->get_netvc()->attributes;
 

Modified: trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc Wed Jun 30 18:44:57 2010
@@ -5544,7 +5544,7 @@ HttpTransact::handle_msie_reload_badness
 void
 HttpTransact::add_client_ip_to_outgoing_request(State * s, HTTPHdr * request)
 {
-  char ip_string[INET6_ADDRSTRLEN + 1];
+  char ip_string[32];
   size_t ip_string_size;
   bool client_ip_set;
   unsigned char *p = (unsigned char *) &(s->client_info.ip);
@@ -5553,9 +5553,9 @@ HttpTransact::add_client_ip_to_outgoing_
     return;
 
   // Always prepare the IP string. ip_to_str() expects host order instead of network order
-  if (ink_inet_ntop((struct sockaddr *)&(s->client_info.addr), ip_string + 1, sizeof(ip_string) - 1) != NULL) {
+  if (LogUtils::ip_to_str(ntohl(s->client_info.ip), ip_string + 1, 30, &ip_string_size) == 0) {
     ip_string[0] = ' ';         // Leading space always, in case we need to concatenate this IP
-    ip_string_size = strlen(ip_string);
+    ip_string_size += 1;
   } else {
     // Failure, omg
     ip_string_size = 0;

Modified: trafficserver/traffic/trunk/proxy/http2/HttpTransact.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpTransact.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpTransact.h (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpTransact.h Wed Jun 30 18:44:57 2010
@@ -796,7 +796,6 @@ public:
     // components is a byte, so:
     // 0x25364758 = 0x25.0x36.0x47.0x58 = 37.54.71.88 in decimal.
     unsigned int ip;
-    struct sockaddr_storage addr;
 
     // port to connect to, except for client
     // connection where it is port on proxy
@@ -817,7 +816,6 @@ public:
       transfer_encoding(NO_TRANSFER_ENCODING),
       ip(0), port(0), state(STATE_UNDEFINED), abort(ABORT_UNDEFINED), port_attribute(SERVER_PORT_DEFAULT)
     {
-      memset(&addr, 0, sizeof(addr));
     };
   }
   ConnectionAttributes;

Modified: trafficserver/traffic/trunk/proxy/logging/Log.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/Log.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/Log.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/Log.cc Wed Jun 30 18:44:57 2010
@@ -330,9 +330,9 @@ Log::init_fields()
 
   Ptr<LogFieldAliasIP> ip_map = NEW(new LogFieldAliasIP);
   field = NEW(new LogField("client_host_ip", "chi",
-                           LogField::STRING,
+                           LogField::sINT,
                            &LogAccess::marshal_client_host_ip,
-                           &LogAccess::unmarshal_str));
+                           &LogAccess::unmarshal_ip, (Ptr<LogFieldAliasMap>) ip_map));
   global_field_list.add(field, false);
   ink_hash_table_insert(field_symbol_hash, "chi", field);
 

Modified: trafficserver/traffic/trunk/proxy/logging/LogAccess.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogAccess.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogAccess.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogAccess.cc Wed Jun 30 18:44:57 2010
@@ -85,7 +85,7 @@ LogAccess::init()
 int
 LogAccess::marshal_client_host_ip(char *buf)
 {
-  DEFAULT_STR_FIELD;
+  DEFAULT_INT_FIELD;
 }
 
 /*-------------------------------------------------------------------------

Modified: trafficserver/traffic/trunk/proxy/logging/LogAccess.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogAccess.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogAccess.h (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogAccess.h Wed Jun 30 18:44:57 2010
@@ -162,7 +162,7 @@ public:
   //
   // client -> proxy fields
   //
-  inkcoreapi virtual int marshal_client_host_ip(char *);        // STR
+  inkcoreapi virtual int marshal_client_host_ip(char *);        // INT
   inkcoreapi virtual int marshal_client_auth_user_name(char *); // STR
   int marshal_client_req_timestamp_sec(char *); // INT
 

Modified: trafficserver/traffic/trunk/proxy/logging/LogAccessHttp.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogAccessHttp.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogAccessHttp.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogAccessHttp.cc Wed Jun 30 18:44:57 2010
@@ -140,17 +140,11 @@ LogAccessHttp::init()
 int
 LogAccessHttp::marshal_client_host_ip(char *buf)
 {
-  char *str = NULL;
-  int len = INK_MIN_ALIGN;
-  char buffer[INET6_ADDRSTRLEN];
-
-  str = const_cast<char*>(ink_inet_ntop(((struct sockaddr *)&(m_http_sm->t_state.client_info.addr)), buffer, sizeof(buffer)));
-  len = LogAccess::strlen(str);
-
   if (buf) {
-    marshal_str (buf, str, len);
+    unsigned int ip = m_http_sm->t_state.client_info.ip;
+    marshal_int(buf, (int64)ntohl(ip));
   }
-  return len;
+  return INK_MIN_ALIGN;
 }
 
 /*-------------------------------------------------------------------------

Modified: trafficserver/traffic/trunk/proxy/logging/LogAccessHttp.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogAccessHttp.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogAccessHttp.h (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogAccessHttp.h Wed Jun 30 18:44:57 2010
@@ -56,7 +56,7 @@ public:
   //
   // client -> proxy fields
   //
-  virtual int marshal_client_host_ip(char *);   // STR
+  virtual int marshal_client_host_ip(char *);   // INT
   virtual int marshal_client_auth_user_name(char *);    // STR
   virtual int marshal_client_req_text(char *);  // STR
   virtual int marshal_client_req_http_method(char *);   // INT

Modified: trafficserver/traffic/trunk/proxy/logging/LogCollationAccept.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogCollationAccept.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogCollationAccept.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogCollationAccept.cc Wed Jun 30 18:44:57 2010
@@ -47,7 +47,7 @@ m_pending_event(NULL)
   // appended to itself if multiple do_io_reads are called requesting
   // small amounts of data.  Most arguments are default except for the
   // last one which we will set to true.
-  m_accept_action = netProcessor.accept(this, m_port, AF_INET, false, INADDR_ANY, false, NO_FD, ACCEPTEX_POOL_SIZE, true);
+  m_accept_action = netProcessor.accept(this, m_port, false, INADDR_ANY, false, NO_FD, ACCEPTEX_POOL_SIZE, true);
   //m_accept_action = netProcessor.accept(this, m_port);
   ink_assert(NULL != m_accept_action);
 

Modified: trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.cc Wed Jun 30 18:44:57 2010
@@ -44,7 +44,7 @@
 #include <sys/capability.h>
 #endif
 
-int bindProxyPort(int, char*, int, int);
+int bindProxyPort(int, in_addr_t, int);
 
 bool
 LocalManager::SetForDup(void *hIOCPort, long lTProcId, void *hTh)
@@ -356,10 +356,8 @@ BaseManager(), run_proxy(proxy_on), reco
   char *incoming_ip_to_bind_str = REC_readString("proxy.local.incoming_ip_to_bind", &found);
   if (found && incoming_ip_to_bind_str != NULL) {
     proxy_server_incoming_ip_to_bind = inet_addr(incoming_ip_to_bind_str);
-    proxy_server_incoming_ip_to_bind_str = incoming_ip_to_bind_str;
   } else {
     proxy_server_incoming_ip_to_bind = htonl(INADDR_ANY);
-    proxy_server_incoming_ip_to_bind_str = NULL;
   }
   config_path = REC_readString("proxy.config.config_dir", &found);
   char *absolute_config_path = Layout::get()->relative(config_path);
@@ -1282,27 +1280,14 @@ LocalManager::listenForProxy()
     if (proxy_server_port[i] != -1) {
 
       if (proxy_server_fd[i] < 0) {
-        int domain;
-        int type;
-
         switch (*proxy_server_port_attributes[i]) {
         case 'D':
           // D is for DNS proxy, udp only
-          type = SOCK_DGRAM;
-          break;
-        default:
-          type = SOCK_STREAM;
-        }
-
-        switch (*(proxy_server_port_attributes[i] + 1)) {
-        case '6':
-          domain = AF_INET6;
+          proxy_server_fd[i] = bindProxyPort(proxy_server_port[i], proxy_server_incoming_ip_to_bind, SOCK_DGRAM);
           break;
         default:
-          domain = AF_INET;
+          proxy_server_fd[i] = bindProxyPort(proxy_server_port[i], proxy_server_incoming_ip_to_bind, SOCK_STREAM);
         }
-
-        proxy_server_fd[i] = bindProxyPort(proxy_server_port[i], proxy_server_incoming_ip_to_bind_str, domain, type);
       }
 
       if (*proxy_server_port_attributes[i] != 'D') {
@@ -1391,14 +1376,11 @@ restoreRootPriv(uid_t *old_euid)
  *  Also, type specifies udp or tcp
  */
 int
-bindProxyPort(int proxy_port, char *incoming_ip_to_bind_str, int domain, int type)
+bindProxyPort(int proxy_port, in_addr_t incoming_ip_to_bind, int type)
 {
   int one = 1;
+  struct sockaddr_in proxy_addr;
   int proxy_port_fd = -1;
-  struct addrinfo hints;
-  struct addrinfo *result;
-  char proxy_port_str[8];
-  int err;
 
 #if !ATS_USE_POSIX_CAP
   bool privBoost = false;
@@ -1417,39 +1399,25 @@ bindProxyPort(int proxy_port, char *inco
 #endif
 
   /* Setup reliable connection, for large config changes */
-  if ((proxy_port_fd = socket(domain, type, 0)) < 0) {
+  if ((proxy_port_fd = socket(AF_INET, type, 0)) < 0) {
     mgmt_elog(stderr, "[bindProxyPort] Unable to create socket : %s\n", strerror(errno));
     _exit(1);
   }
-  if (domain == AF_INET6) {
-    if (setsockopt(proxy_port_fd, IPPROTO_IPV6, IPV6_V6ONLY, ON, sizeof(int)) < 0) {
-      mgmt_elog(stderr, "[bindProxyPort] Unable to set socket options: %d : %s\n", proxy_port, strerror(errno));
-    }
-  }
   if (setsockopt(proxy_port_fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(int)) < 0) {
     mgmt_elog(stderr, "[bindProxyPort] Unable to set socket options: %d : %s\n", proxy_port, strerror(errno));
     _exit(1);
   }
 
-  snprintf(proxy_port_str, sizeof(proxy_port_str), "%d", proxy_port);
-  memset(&hints, 0, sizeof(hints));
-  hints.ai_family = domain;
-  hints.ai_socktype = type;
-  hints.ai_flags = AI_PASSIVE;
-
-  err = getaddrinfo(incoming_ip_to_bind_str, proxy_port_str, &hints, &result);
-  if (err != 0) {
-    mgmt_elog(stderr, "[bindProxyPort] Unable to get address info: %s : %s\n", incoming_ip_to_bind_str, gai_strerror(err));
-    _exit(1);
-  }
+  memset(&proxy_addr, 0, sizeof(proxy_addr));
+  proxy_addr.sin_family = AF_INET;
+  proxy_addr.sin_addr.s_addr = incoming_ip_to_bind;
+  proxy_addr.sin_port = htons(proxy_port);
 
-  if((bind(proxy_port_fd, result->ai_addr, result->ai_addrlen)) < 0) {
+  if ((bind(proxy_port_fd, (struct sockaddr *) &proxy_addr, sizeof(proxy_addr))) < 0) {
     mgmt_elog(stderr, "[bindProxyPort] Unable to bind socket: %d : %s\n", proxy_port, strerror(errno));
     _exit(1);
   }
 
-  freeaddrinfo(result);
-
   Debug("lm", "[bindProxyPort] Successfully bound proxy port %d\n", proxy_port);
 
 #if !ATS_USE_POSIX_CAP

Modified: trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.h?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.h Wed Jun 30 18:44:57 2010
@@ -144,7 +144,6 @@ public:
   volatile char proxy_server_port_attributes[MAX_PROXY_SERVER_PORTS][MAX_ATTR_LEN];
   volatile int proxy_server_fd[MAX_PROXY_SERVER_PORTS];
   in_addr_t proxy_server_incoming_ip_to_bind;
-  char *proxy_server_incoming_ip_to_bind_str;
 
   int process_server_timeout_secs;
   int process_server_timeout_msecs;

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc?rev=959407&r1=959406&r2=959407&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cop/TrafficCop.cc Wed Jun 30 18:44:57 2010
@@ -853,11 +853,8 @@ open_socket(int port, const char *ip = N
 {
 
   int sock;
+  struct sockaddr_in name;
   int err;
-  struct addrinfo hints;
-  struct addrinfo *result;
-  struct addrinfo *result_to_bind;
-  char port_str[8];
 
 #ifdef TRACE_LOG_COP
   cop_log(COP_DEBUG, "Entering open_socket(%d, %s, %s)\n", port, ip, ip_to_bind);
@@ -865,21 +862,9 @@ open_socket(int port, const char *ip = N
   if (!ip) {
     ip = "127.0.0.1";
   }
-
-  snprintf(port_str, sizeof(port_str), "%d", port);
-  memset(&hints, 0, sizeof(hints));
-  hints.ai_family = AF_UNSPEC;
-  hints.ai_socktype = SOCK_STREAM;
-
-  err = getaddrinfo(ip, port_str, &hints, &result);
-  if (err != 0) {
-    cop_log (COP_WARNING, "(test) unable to get address info [%d %s] at ip %s, port %s\n", err, gai_strerror(err), ip, port_str);
-    goto getaddrinfo_error;
-  }
-
   // Create a socket
   do {
-    sock = socket(result->ai_family, result->ai_socktype, 0);
+    sock = socket(AF_INET, SOCK_STREAM, 0);
   } while ((sock < 0) && (transient_error(errno, TRANSIENT_ERROR_WAIT_MS)));
 
   if (sock < 0) {
@@ -888,22 +873,13 @@ open_socket(int port, const char *ip = N
   }
 
   if (ip_to_bind) {
-    memset(&hints, 0, sizeof(hints));
-    hints.ai_family = result->ai_family;
-    hints.ai_socktype = result->ai_socktype;
-
-    err = getaddrinfo(ip_to_bind, NULL, &hints, &result_to_bind);
-    if (err != 0) {
-      cop_log (COP_WARNING, "(test) unable to get address info [%d %s] at ip %s\n", err, gai_strerror(err), ip_to_bind);
-      freeaddrinfo(result_to_bind);
-      goto error;
+    memset(&name, 0, sizeof(name));
+    name.sin_family = AF_INET;
+    name.sin_addr.s_addr = inet_addr(ip_to_bind);
+    name.sin_port = 0;
+    if (safe_bind(sock, (struct sockaddr *) &name, sizeof(name)) < 0) {
+      cop_log(COP_WARNING, "(test) unable to bind socket [%d '%s']\n", errno, strerror(errno));
     }
-
-    if (safe_bind(sock, result_to_bind->ai_addr, result_to_bind->ai_addrlen) < 0) {
-      cop_log (COP_WARNING, "(test) unable to bind socket [%d '%s']\n", errno, strerror (errno));
-    }
-
-    freeaddrinfo(result_to_bind);
   }
 
   // Put the socket in non-blocking mode...just to be extra careful
@@ -917,8 +893,13 @@ open_socket(int port, const char *ip = N
     goto error;
   }
   // Connect to the specified port on the machine we're running on.
+  memset(&name, 0, sizeof(name));
+  name.sin_family = AF_INET;
+  name.sin_port = htons(port);
+  name.sin_addr.s_addr = inet_addr(ip);
+
   do {
-    err = connect(sock, result->ai_addr, result->ai_addrlen);
+    err = connect(sock, (struct sockaddr *) &name, sizeof(name));
   } while ((err < 0) && (transient_error(errno, TRANSIENT_ERROR_WAIT_MS)));
 
   if ((err < 0) && (errno != EINPROGRESS)) {
@@ -928,8 +909,6 @@ open_socket(int port, const char *ip = N
 #ifdef TRACE_LOG_COP
   cop_log(COP_DEBUG, "Leaving open_socket(%d, %s, %s) --> %d\n", port, ip, ip_to_bind, sock);
 #endif
-  freeaddrinfo(result);
-
   return sock;
 
 error:
@@ -939,8 +918,6 @@ error:
 #ifdef TRACE_LOG_COP
   cop_log(COP_DEBUG, "Leaving open_socket(%d, %s, %s) --> %d\n", port, ip, ip_to_bind, -1);
 #endif
-getaddrinfo_error:
-  freeaddrinfo(result);
   return -1;
 }
 
@@ -1226,13 +1203,12 @@ test_server_http_port()
 {
   char request[1024];
   char *ip;
-  char localhost[] = "127.0.0.1";
 
   // Generate a request for a the 'synthetic.txt' document the manager
   // servers up on the autoconf port.
   snprintf(request, sizeof(request), "GET http://127.0.0.1:%d/synthetic.txt HTTP/1.0\r\n\r\n", autoconf_port);
 
-  ip = (strcmp(http_backdoor_ip, "NULL") == 0) ? localhost : http_backdoor_ip;
+  ip = (strcmp(http_backdoor_ip, "NULL") == 0) ? NULL : http_backdoor_ip;
   return test_http_port(http_backdoor_port, request, server_timeout * 1000, ip, ip);
 }
 



Mime
View raw message