LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

ldirectord and check_http

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: ldirectord and check_http
From: David Rodrigues <drodrig@xxxxxxxxxxxxxxxx>
Date: Mon, 4 Sep 2000 23:54:06 -0400 (EDT)
Hello all.

I recently installed ldirectord. I was having some problems until I looked
at the code and found the following function:

sub check_http
{
        my ($v, $r) = @_;
        my $ua = new LWP::UserAgent;
        $ua->agent("LinuxDirector/0.1".$ua->agent);
        $ua->timeout($TIMEOUT);
        my $req = new HTTP::Request(GET=>"$$r{url}");
        my $res = $ua->request($req);
        my $recstr = $$v{receive};
        if ($res->is_success && (!($recstr =~ /.+/) || $res->content =~
/$recstr}/)) {
                service_set($v, $r, "up");
        } else {
                service_set($v, $r, "down");
        }
}

Note the line:
 if ($res->is_success && (!($recstr =~ /.+/) || $res->content
=~/$recstr}/)) {

I noticed the "}" in "$recstr}". I couldn't see any reason for it, so I
removed it. Now ldirectord appears to work fine.

Is the "}" supposed to be there, and was I doing something else wrong to
cause the problems (instant removals of all real servers and addition of
fallback server), or is this a bug? I'm using the ldirectord with version
info of 1.11 2000/06/23 08:01:36.



<Prev in Thread] Current Thread [Next in Thread>