crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs

incrclientcount.c (1071B)


      1 /*************************************************************************
      2  * This file is part of Crosroads 1.23, a load balancer and fail over
      3  * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL.
      4  * Visit http://crossroads.e-tunity.com for information.
      5  *************************************************************************/
      6 
      7 #include "crossroads.h"
      8 
      9 void incr_client_count () {
     10     unsigned totclients = 0;
     11     int i;
     12 
     13     if (program_stage != stage_serving)
     14 	return;
     15     
     16     if (current_backend >= 0) {
     17 	lock_reporter();
     18 	servicereport->backendstate[current_backend].nclients++;
     19 	servicereport->backendstate[current_backend].totuses++;
     20 	for (i = 0; i < activeservice->nbackend; i++)
     21 	    totclients +=
     22 		servicereport->backendstate[i].nclients;
     23 	servicereport->nclients = totclients;
     24 	unlock_reporter();
     25 	sysrun (activeservice->backend[current_backend].onstart);
     26 
     27 	msg ("Service %s: Activity on back end %d now %d, total %d",
     28 	     activeservice->name,
     29 	     servicereport->backendstate[current_backend].nclients,
     30 	     totclients);
     31     }
     32 }