On Wed, 20 Jan 2010, Ben Norris wrote:
Hi everyone
Hi again,
We are using HAProxy 1.3.22 and Sun GlassFish Enterprise Server v2.1 (9.1.1)
(build b60e-fcs)
I installed HAProxy 1.4-dev6 in order to get more info from the health check
failures which gave the info?
[WARNING] 014/171730 (22990) : Server argggggggh/server18080 is DOWN, reason: Layer7
invalid response, info: "HTTP/1.1 ", check duration: 0ms.
<CUT>
Please check the attached patch. It definitely is not the correct solution
but it should work for now as a quick workaround.
Best regards,
Krzysztof Olędzkidiff --git a/src/checks.c b/src/checks.c
index 7eeced2..9076aef 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -786,9 +786,9 @@ static int event_srv_chk_r(int fd)
* but the connection was closed on the remote end. Fortunately, recv
still
* works correctly and we don't need to do the getsockopt() on linux.
*/
- len = recv(fd, trash, sizeof(trash), 0);
- if (unlikely(len < 0)) {
- if (errno == EAGAIN) {
+ len = recv(fd, trash, sizeof(trash), MSG_PEEK);
+ if (unlikely(len < 15)) {
+ if (errno == EAGAIN || len > 0) {
/* not ready, we want to poll first */
fdtab[fd].ev &= ~FD_POLL_IN;
return 0;