]> git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/stub_HelperChildConfig.cc
helper protocol concurrency=0 is the old protocol, not =1
[thirdparty/squid.git] / src / tests / stub_HelperChildConfig.cc
1 #include "config.h"
2 #include "HelperChildConfig.h"
3 #include "globals.h"
4
5 #include <string.h>
6
7 HelperChildConfig::HelperChildConfig(const unsigned int m, const unsigned int s, const unsigned int i, const unsigned int cc) :
8 n_max(m),
9 n_startup(s),
10 n_idle(i),
11 concurrency(cc),
12 n_running(0),
13 n_active(0)
14 {}
15
16 HelperChildConfig::~HelperChildConfig()
17 {}
18
19 HelperChildConfig &
20 HelperChildConfig::operator =(const HelperChildConfig &rhs)
21 {
22 memcpy(this, &rhs, sizeof(HelperChildConfig));
23 return *this;
24 }
25
26 const int
27 HelperChildConfig::needNew() const
28 {
29 /* during the startup and reconfigure use our special amount... */
30 if (starting_up || reconfiguring) return n_startup;
31
32 /* keep a minimum of n_idle helpers free... */
33 if ( (n_active + n_idle) < n_max) return n_idle;
34
35 /* dont ever start more than n_max processes. */
36 return (n_max - n_active);
37 }
38
39 void
40 HelperChildConfig::parseConfig()
41 {
42 fprintf(stderr, "HelperChildConfig::parseConfig not implemented.");
43 exit(1);
44 }