source: squid-ssl/trunk/fuentes/src/icmp/stub_HelperChildConfig.cc @ 5495

Last change on this file since 5495 was 5495, checked in by Juanma, 22 months ago

Initial release

File size: 1.1 KB
Line 
1/*
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#include "squid.h"
10#include "globals.h"
11#include "helper/ChildConfig.h"
12
13#define STUB_API "stub_HelperChildconfig.cc"
14#include "tests/STUB.h"
15
16#include <cstring>
17
18Helper::ChildConfig::ChildConfig():
19    n_max(0),
20    n_startup(0),
21    n_idle(1),
22    concurrency(0),
23    n_running(0),
24    n_active(0)
25{}
26
27Helper::ChildConfig::ChildConfig(const unsigned int m):
28    n_max(m),
29    n_startup(0),
30    n_idle(1),
31    concurrency(0),
32    n_running(0),
33    n_active(0)
34{}
35
36int
37Helper::ChildConfig::needNew() const
38{
39    /* during the startup and reconfigure use our special amount... */
40    if (starting_up || reconfiguring) return n_startup;
41
42    /* keep a minimum of n_idle helpers free... */
43    if ( (n_active + n_idle) < n_max) return n_idle;
44
45    /* dont ever start more than n_max processes. */
46    return (n_max - n_active);
47}
48
49void Helper::ChildConfig::parseConfig() STUB
50
Note: See TracBrowser for help on using the repository browser.