Hi,

On Tue, Feb 24, 2009 at 11:04:05AM +0800, FinalBSD wrote:
> Hi Willy,
>   I updated this patch, rewrite it and fixed the err. can you check it
> again?
> syntax:
> 
> expect status 200
> expect ! status 200
> 
> expect string ABCD
> expect ! string ABCD
> 
> expect rstatus ^2
> expect ! rstatus ^2
> 
> expect rstring A..D
> expect ! rstring A..D
> 
> rstatus, rstring means use regex to do the http_check.
> By default, it's case sensitive, if we need case insensitive, I  think
> 'iexpect' keyword should be added.

we could proceed like with the ACLs, with "-i" between "expect" and
"string" for instance.

I'm now wondering if we could re-use the ACL framework for this. Maybe
it's not too hard to adapt, and then we could directly reuse all the
available keywords and tests. There is already a "status" match in
the ACLs. We can match many things in headers (eg: expect a specific
Location: or Cache-control: header). We could add the content matching
to the ACLs for completeness. We could add the "body_reg" and "body_str"
matches to complete what is currently available.

For this to work, I think that we should simply fake a session and
transaction when performing the health-checks, then parse the HTTP
response just like we do with normal server responses, and then call
the ACL framework.

What do you think ? Maybe as a first step, we should simply mimmick
that based on your work and with very careful keyword and syntax
selection, then later change that to rely on the ACL framework without
changing the syntax. That would be really nice in my opinion.

Regards,
Willy


Reply via email to