You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2010/09/22 19:11:06 UTC

svn commit: r1000092 - in /trafficserver/traffic/trunk: iocore/cluster/ClusterProcessor.cc proxy/mgmt2/RecordsConfig.cc proxy/mgmt2/cluster/ClusterCom.cc

Author: zwoop
Date: Wed Sep 22 17:11:06 2010
New Revision: 1000092

URL: http://svn.apache.org/viewvc?rev=1000092&view=rev
Log:
TS-447 Some fixes related to previous commit

Modified:
    trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc
    trafficserver/traffic/trunk/proxy/mgmt2/RecordsConfig.cc
    trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc?rev=1000092&r1=1000091&r2=1000092&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc Wed Sep 22 17:11:06 2010
@@ -766,7 +766,9 @@ ClusterProcessor::start()
       initialize_thread_for_net(eventProcessor.eventthread[ET_CLUSTER][i], i);
     }
 
-    IOCORE_RegisterConfigString(RECT_CONFIG, "proxy.config.cluster.cluster_configuration", "cluster.config", RECU_NULL, RECC_NULL, NULL);
+    // TODO: This had to be moved back to RecordsConfig.cc, because of "order" mattering ...
+    // IOCORE_RegisterConfigString(RECT_CONFIG, "proxy.config.cluster.cluster_configuration", "cluster.config", RECU_NULL, RECC_NULL, NULL);
+
     IOCORE_RegisterConfigUpdateFunc("proxy.config.cluster.cluster_configuration", machine_config_change, (void *) CLUSTER_CONFIG);
     do_machine_config_change((void *) CLUSTER_CONFIG, "proxy.config.cluster.cluster_configuration");
 #ifdef USE_SEPARATE_MACHINE_CONFIG

Modified: trafficserver/traffic/trunk/proxy/mgmt2/RecordsConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/RecordsConfig.cc?rev=1000092&r1=1000091&r2=1000092&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/RecordsConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/RecordsConfig.cc Wed Sep 22 17:11:06 2010
@@ -1639,6 +1639,9 @@ RecordElement RecordsConfig[] = {
   //# Cluster Subsystem
   //#
   //##############################################################################
+  {CONFIG, "proxy.config.cluster.cluster_configuration", "", INK_STRING, "cluster.config", RU_NULL, RR_NULL, RC_NULL,
+   NULL, RA_NULL}
+  ,
   {CONFIG, "proxy.config.cluster.ethernet_interface", "", INK_STRING, NULL, RU_RESTART_TS, RR_REQUIRED, RC_STR,
    "^[^[:space:]]*$", RA_NULL}
   ,

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc?rev=1000092&r1=1000091&r2=1000092&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cluster/ClusterCom.cc Wed Sep 22 17:11:06 2010
@@ -359,10 +359,8 @@ cluster_com_port_watcher(const char *nam
 ClusterCom::ClusterCom(unsigned long oip, char *host, int port, char *group, int sport, char *p):our_wall_clock(0), alive_peers_count(0), reliable_server_fd(0), broadcast_fd(0),
 receive_fd(0)
 {
-  int
-    rec_err;
-  bool
-    found = false;
+  int rec_err;
+  bool found = false;
 
   init = false;
   if (strlen(host) >= 1024) {
@@ -378,8 +376,8 @@ receive_fd(0)
 
   /* Get the cluster type */
   cluster_type = CLUSTER_INVALID;
-  RecInt
-    rec_int;
+  RecInt rec_int;
+
   rec_err = RecGetRecordInt("proxy.local.cluster.type", &rec_int);
   cluster_type = (MgmtClusterType) rec_int;
   found = (rec_err == REC_ERR_OKAY);
@@ -397,12 +395,16 @@ receive_fd(0)
     break;
   }
   /* Get the cluster config file name + path */
-  RecString
-    cluster_file;
+  RecString cluster_file;
+
   rec_err = RecGetRecordString_Xmalloc("proxy.config.cluster.cluster_configuration", &cluster_file);
   found = (rec_err == REC_ERR_OKAY);
 
-  if (!found || strlen(p) + strlen(cluster_file) >= 1024) {
+  if (!found) {
+    mgmt_fatal(stderr, "[ClusterCom::ClusterCom] no cluster_configuration filename configured\n");
+  }
+
+  if (strlen(p) + strlen(cluster_file) >= 1024) {
     mgmt_fatal(stderr, "[ClusterCom::ClusterCom] path + filename too large\n");
   }
   // XXX: This allows to have absolute config cluster_configuration directive.
@@ -474,17 +476,6 @@ receive_fd(0)
 }                               /* End ClusterCom::ClusterCom */
 
 
-// this function created to get around a bug in the Linux version
-// of gcc
-// This doesn't seem to be used.
-#ifdef NOT_USED_HERE
-static void
-sum_agg_data(Records * paggregated_node_data, ClusterPeerInfo * cpi, int j)
-{
-  // fix me -- what does aggregated_node_data do?
-}
-#endif
-
 /*
  * checkPeers(...)
  *   Function checks on our peers by racing through the peer list(ht) and
@@ -2198,9 +2189,7 @@ ClusterCom::receiveIncomingMessage(char 
 {
   int nbytes = 0, addr_len = sizeof(receive_addr);
 
-  if ((nbytes = recvfrom(receive_fd, buf, max, 0, (struct sockaddr *) &receive_addr,
-                         (socklen_t *) & addr_len
-       )) < 0) {
+  if ((nbytes = recvfrom(receive_fd, buf, max, 0, (struct sockaddr *) &receive_addr, (socklen_t *) & addr_len)) < 0) {
     mgmt_elog(stderr, "[ClusterCom::receiveIncomingMessage] Receive failed\n");
   }
   return nbytes;