~ps10gel/ubuntu/xenial/trafficserver/6.2.0

« back to all changes in this revision

Viewing changes to iocore/cluster/ClusterMachine.cc

  • Committer: Package Import Robot
  • Author(s): Aron Xu
  • Date: 2013-05-09 01:00:04 UTC
  • mto: (1.1.11) (5.3.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: package-import@ubuntu.com-20130509010004-9fqq9n0adseg3f8w
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
  else
147
147
    hostname_len = 0;
148
148
 
149
 
  IOCORE_ReadConfigInteger(num_connections, "proxy.config.cluster.num_of_cluster_connections");
 
149
  num_connections = eventProcessor.n_threads_for_type[ET_CLUSTER];
150
150
  clusterHandlers = (ClusterHandler **)ats_calloc(num_connections, sizeof(ClusterHandler *));
151
151
}
152
152
 
153
153
ClusterHandler *ClusterMachine::pop_ClusterHandler(int no_rr)
154
154
{
 
155
  int find = 0;
155
156
  int64_t now = rr_count;
156
157
  if (no_rr == 0) {
157
158
    ink_atomic_increment(&rr_count, 1);
158
159
  }
 
160
 
 
161
  /* will happen when ts start (cluster connection is not established) */
 
162
  while (!clusterHandlers[now % this->num_connections] && (find < this->num_connections)) {
 
163
    now++;
 
164
    find++;
 
165
  }
159
166
  return this->clusterHandlers[now % this->num_connections];
160
167
}
161
168