~ubuntu-branches/ubuntu/vivid/haproxy/vivid

« back to all changes in this revision

Viewing changes to src/server.c

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Cornet
  • Date: 2008-06-20 00:38:50 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080620003850-hvvx94g2xz2l2xbg
Tags: 1.3.15.1-1
* New Upstream Version
* Upgrade standards version to 3.8.0 (no change needed).
* Build with TARGET=linux26 on linux, TARGET=generic on other systems.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Server management functions.
3
3
 *
4
4
 * Copyright 2000-2006 Willy Tarreau <w@1wt.eu>
 
5
 * Copyright 2007-2008 Krzysztof Piotr Oledzki <ole@ans.pl>
5
6
 *
6
7
 * This program is free software; you can redistribute it and/or
7
8
 * modify it under the terms of the GNU General Public License
25
26
        return now.tv_sec - s->last_change + s->down_time;
26
27
}
27
28
 
 
29
int srv_getinter(struct server *s) {
 
30
 
 
31
        if ((s->state & SRV_CHECKED) && (s->health == s->rise + s->fall - 1))
 
32
                return s->inter;
 
33
 
 
34
        if (!(s->state & SRV_RUNNING) && s->health==0)
 
35
                return (s->downinter)?(s->downinter):(s->inter);
 
36
 
 
37
        return (s->fastinter)?(s->fastinter):(s->inter);
 
38
}
 
39
 
 
40
 
28
41
/*
29
42
 * Local variables:
30
43
 *  c-indent-level: 8