> I will try to trace where the check fails and why. I guess it is easiest
> for me to do it because i can replicate the error anytime. ...
Ok, looks like the culprit is this piece of code:
-----
/* Close the transmit channel, leaving the connection half-open... */
int shut = shutdown(fd, SHUT_WR);
int err = errno;
if (shut == -1)
{
Alert("event_srv_chk_w(): err = %i, %s\n", err, strerror(err));
}
-----
If I disable this (as it was before) everything works as it should. It even
figures out (correctly) that one server returns "all_is_ok" and another just
empty string - and takes the other one down. Nice, exactly what I need. :D
However, I have no idea why it works now. My knowledge of sockets is very
limited. Also, I have found this in the first 10 minutes of looking at the
code - I found that httpchk_expect() is not even called, so I checked other
stuff in the patch and this looked very suspicious to me so I disabled it. And
it just started working. I also figured that shutting down socket for writes
only is... well, a bit black-magic-ish and not really necessary. ;) You must
shutdown the whole socket sometime later anyway.
In other words: I can't say that this is a correct way to deal with the
problem - I haven't got a clue. But it works now.
Does it shed any light on the issue?
Thanks,
Anze