You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/05/23 02:01:51 UTC

git commit: TS-1909: Fix trafic_cop socket binding

Updated Branches:
  refs/heads/master 1158da9ef -> 4b1b7e1f6


TS-1909: Fix trafic_cop socket binding

The additional bind(2) call in Server::setup_fd_for_listen() causes
Traffic Server to not listen on ports that are handed down from
traffic_cop. This is because the 2nd bind fails since the socket
iw already bound.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4b1b7e1f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4b1b7e1f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4b1b7e1f

Branch: refs/heads/master
Commit: 4b1b7e1f67aa3a41d4aecf4843a409afac77b6ad
Parents: 1158da9
Author: James Peach <jp...@apache.org>
Authored: Wed May 22 16:59:42 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Wed May 22 17:01:39 2013 -0700

----------------------------------------------------------------------
 iocore/net/Connection.cc |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4b1b7e1f/iocore/net/Connection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/Connection.cc b/iocore/net/Connection.cc
index e208347..deff04d 100644
--- a/iocore/net/Connection.cc
+++ b/iocore/net/Connection.cc
@@ -235,10 +235,6 @@ Server::setup_fd_for_listen(
     goto Lerror;
   }
 
-  if ((res = socketManager.ink_bind(fd, &addr.sa, ats_ip_size(&addr.sa), IPPROTO_TCP)) < 0) {
-    goto Lerror;
-  }
-
 #ifdef SET_TCP_NO_DELAY
   if ((res = safe_setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, SOCKOPT_ON, sizeof(int))) < 0) {
     goto Lerror;
@@ -316,6 +312,10 @@ Server::listen(bool non_blocking, int recv_bufsize, int send_bufsize, bool trans
     goto Lerror;
   }
 
+  if ((res = socketManager.ink_bind(fd, &addr.sa, ats_ip_size(&addr.sa), IPPROTO_TCP)) < 0) {
+    goto Lerror;
+  }
+
   if ((res = safe_listen(fd, get_listen_backlog())) < 0) {
     goto Lerror;
   }