~andreserl/ubuntu/lucid/keepalived/merge-from-squeeze-lp519940

« back to all changes in this revision

Viewing changes to keepalived/check/check_tcp.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2009-05-12 20:26:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090512202615-k850bw35qpuvpq4p
Tags: 1.1.17-1ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/rules: DEB_UPDATE_RCD_PARAMS := expicit init start/stop
    parameters (don't stop at 0 and 6)
  - debian/init.d: init script header adapted to stop rule
  - debian/keepalived.postinst: Remove shutdown and reboot links

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *
6
6
 * Part:        TCP checker.
7
7
 *
8
 
 * Version:     $Id: check_tcp.c,v 1.1.15 2007/09/15 04:07:41 acassen Exp $
 
8
 * Version:     $Id: check_tcp.c,v 1.1.17 2009/03/05 01:31:12 acassen Exp $
9
9
 *
10
10
 * Author:      Alexandre Cassen, <acassen@linux-vs.org>
11
11
 *
19
19
 *              as published by the Free Software Foundation; either version
20
20
 *              2 of the License, or (at your option) any later version.
21
21
 *
22
 
 * Copyright (C) 2001-2007 Alexandre Cassen, <acassen@freebox.fr>
 
22
 * Copyright (C) 2001-2009 Alexandre Cassen, <acassen@freebox.fr>
23
23
 */
24
24
 
25
25
#include "check_tcp.h"
27
27
#include "memory.h"
28
28
#include "ipwrapper.h"
29
29
#include "layer4.h"
 
30
#include "logger.h"
30
31
#include "smtp.h"
31
32
#include "utils.h"
32
33
#include "parser.h"
48
49
{
49
50
        tcp_checker *tcp_chk = CHECKER_DATA(data);
50
51
 
51
 
        syslog(LOG_INFO, "   Keepalive method = TCP_CHECK");
 
52
        log_message(LOG_INFO, "   Keepalive method = TCP_CHECK");
52
53
        if (tcp_chk->connection_port)
53
 
                syslog(LOG_INFO, "   Connection port = %d",
 
54
                log_message(LOG_INFO, "   Connection port = %d",
54
55
                       ntohs(tcp_chk->connection_port));
55
56
        if (tcp_chk->bindto)
56
 
                syslog(LOG_INFO, "   Bind to = %s", inet_ntop2(tcp_chk->bindto));
57
 
        syslog(LOG_INFO, "   Connection timeout = %d", tcp_chk->connection_to/TIMER_HZ);
 
57
                log_message(LOG_INFO, "   Bind to = %s", inet_ntop2(tcp_chk->bindto));
 
58
        log_message(LOG_INFO, "   Connection timeout = %d", tcp_chk->connection_to/TIMER_HZ);
58
59
}
59
60
 
60
61
void
123
124
                close(thread_obj->u.fd);
124
125
 
125
126
                if (!svr_checker_up(checker_obj->id, checker_obj->rs)) {
126
 
                        syslog(LOG_INFO, "TCP connection to [%s:%d] success.",
 
127
                        log_message(LOG_INFO, "TCP connection to [%s:%d] success.",
127
128
                               inet_ntop2(CHECKER_RIP(checker_obj))
128
129
                               , ntohs(addr_port));
129
130
                        smtp_alert(checker_obj->rs, NULL, NULL,
137
138
        } else {
138
139
 
139
140
                if (svr_checker_up(checker_obj->id, checker_obj->rs)) {
140
 
                        syslog(LOG_INFO, "TCP connection to [%s:%d] failed !!!",
 
141
                        log_message(LOG_INFO, "TCP connection to [%s:%d] failed !!!",
141
142
                               inet_ntop2(CHECKER_RIP(checker_obj))
142
143
                               , ntohs(addr_port));
143
144
                        smtp_alert(checker_obj->rs, NULL, NULL,