[Linux-HA] ldirectord 1.99 fails to recognize HTTPS server being shut down

Volker Dormeyer volker at ixolution.de
Mon Jul 4 15:56:29 MDT 2005


Hi all,

 * On Mon, 04 Jul 2005 23:19:23 +0200,
 * Bernhard Erdmann <be at berdmann.de> wrote:

 >> Thanks for pointing this out, its clearly broken.
 >> Can you see if the following patch helps your cause?

 > Hi, this patch disables every real server, no matter if it's alive or not.

I believe this has something to do with the httpmethod patch I sent in
some time ago. Do you use httpmethod=HEAD?

If so, this patch might help you:

--- ldirectord.orig     2005-03-25 23:49:17.096482151 +0100
+++ ldirectord  2005-03-26 00:02:13.183817291 +0100
@@ -1858,7 +1858,7 @@
                $port=(defined $$v{checkport}?$$v{checkport}:$$r{port})
        }
        my $virtualhost = (defined $$v{virtualhost} ? $$v{virtualhost} : $host);
-       my ($page, $errors, $cert, $head, $body, $response, $result);
+       my ($page, $errors, $cert, $head, $body, $response);
        my $msg = "$$v{httpmethod}" . " $uri HTTP/1.0" . $CRLF
                . "Host: " . $virtualhost . $CRLF
                . "Accept: */*" . $CRLF . $CRLF;
@@ -1879,10 +1879,10 @@
                ($response, $head) = split /\s?\n/, $head, 2;
                &ld_debug(2, "Result: $response");
                my $recstr = $$r{receive};
-               if($result =~ /error/i ||
+               if( !($response =~ /20[0-9]/) ||
                                ($recstr =~ /.+/ && !($body =~ /$recstr/))) {
                        alarm(0);
-                       die("$result");
+                       die("$response");
                }
        };

It parses the return code. If HTTP return code is 20x (OK) or something
like that, it succeeds. But it fails if you get a redirect return code
(i. e. greater than 300). It works for me.

@Horms: Maybe you can remember, some time ago I reported this problem
with the httpmethod patch I sent and the HTTPS check. Maybe the report
was lost within numbers of emails you receive every day. Sure, this
patch is not the best way to do this. That's why I replaced Net::SSLeay
by LWP (shouldn't have a memory leak anymore) in another patch.

Thanks and regards,
Volker

-- 
 Volker Dormeyer	<volker at ixolution.de>



More information about the Linux-HA mailing list