~ubuntu-branches/ubuntu/karmic/haproxy/karmic

« back to all changes in this revision

Viewing changes to include/proto/proxy.h

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Cornet
  • Date: 2009-06-26 00:11:01 UTC
  • mfrom: (1.1.6 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090626001101-qo261ke2mjh3d8cn
Tags: 1.3.18-1
* New Upstream Version (Closes: #534583).
* Add contrib directory in docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#define _PROTO_PROXY_H
24
24
 
25
25
#include <common/config.h>
 
26
#include <common/ticks.h>
26
27
#include <common/time.h>
27
28
#include <types/proxy.h>
 
29
#include <proto/freq_ctr.h>
28
30
 
29
31
int start_proxies(int verbose);
30
 
void maintain_proxies(struct timeval *next);
 
32
void maintain_proxies(int *next);
31
33
void soft_stop(void);
32
34
void pause_proxy(struct proxy *p);
33
35
void stop_proxy(struct proxy *p);
38
40
const char *proxy_mode_str(int mode);
39
41
struct proxy *findproxy(const char *name, int mode, int cap);
40
42
struct server *findserver(const struct proxy *px, const char *name);
41
 
int proxy_parse_timeout(const char **args, struct proxy *proxy,
42
 
                        struct proxy *defpx, char *err, int errlen);
 
43
int proxy_cfg_ensure_no_http(struct proxy *curproxy, const char *file);
43
44
 
44
45
/*
45
46
 * This function returns a string containing the type of the proxy in a format
53
54
/* this function initializes all timeouts for proxy p */
54
55
static inline void proxy_reset_timeouts(struct proxy *proxy)
55
56
{
56
 
        tv_eternity(&proxy->timeout.client);
57
 
        tv_eternity(&proxy->timeout.tarpit);
58
 
        tv_eternity(&proxy->timeout.queue);
59
 
        tv_eternity(&proxy->timeout.connect);
60
 
        tv_eternity(&proxy->timeout.server);
61
 
        tv_eternity(&proxy->timeout.appsession);
62
 
        tv_eternity(&proxy->timeout.httpreq);
63
 
        tv_eternity(&proxy->timeout.check);
 
57
        proxy->timeout.client = TICK_ETERNITY;
 
58
        proxy->timeout.tarpit = TICK_ETERNITY;
 
59
        proxy->timeout.queue = TICK_ETERNITY;
 
60
        proxy->timeout.connect = TICK_ETERNITY;
 
61
        proxy->timeout.server = TICK_ETERNITY;
 
62
        proxy->timeout.appsession = TICK_ETERNITY;
 
63
        proxy->timeout.httpreq = TICK_ETERNITY;
 
64
        proxy->timeout.check = TICK_ETERNITY;
 
65
}
 
66
 
 
67
/* increase the number of cumulated connections on the designated frontend */
 
68
static void inline proxy_inc_fe_ctr(struct proxy *fe)
 
69
{
 
70
        fe->cum_feconn++;
 
71
        update_freq_ctr(&fe->fe_sess_per_sec, 1);
 
72
        if (fe->fe_sess_per_sec.curr_ctr > fe->fe_sps_max)
 
73
                fe->fe_sps_max = fe->fe_sess_per_sec.curr_ctr;
 
74
}
 
75
 
 
76
/* increase the number of cumulated connections on the designated backend */
 
77
static void inline proxy_inc_be_ctr(struct proxy *be)
 
78
{
 
79
        be->cum_beconn++;
 
80
        update_freq_ctr(&be->be_sess_per_sec, 1);
 
81
        if (be->be_sess_per_sec.curr_ctr > be->be_sps_max)
 
82
                be->be_sps_max = be->be_sess_per_sec.curr_ctr;
64
83
}
65
84
 
66
85
#endif /* _PROTO_PROXY_H */