File: target.cc

package info (click to toggle)
crossroads 2.65-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,664 kB
  • ctags: 355
  • sloc: cpp: 4,212; perl: 1,658; xml: 269; makefile: 186; sh: 46
file content (10 lines) | stat: -rw-r--r-- 305 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
#include "firstactive"

unsigned Firstactive::target(struct in_addr clientip,
			     BackendVector const &targetlist) {
    if ( targetlist.size() == 0 ||
	 ! balancer.backend(targetlist[0]).available() )
	throw Error("First-active algorithm: no available back ends");
    return (targetlist[0]);
}