]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: checks: report handshake failures
authorWilly Tarreau <w@1wt.eu>
Sat, 24 Nov 2012 10:14:45 +0000 (11:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 24 Nov 2012 10:14:45 +0000 (11:14 +0100)
Up to now, only data layer failures were reported to the task, but
if a handshake failed from the beginning, the error was not reported
as a failure.

src/checks.c

index b23fa86bcec1bcc7983d40f1fe2fe9ad6953aa00..a0637c29df4d76a36f1bb75e558b610cd1604376 100644 (file)
@@ -1183,8 +1183,12 @@ static int wake_srv_chk(struct connection *conn)
 {
        struct server *s = conn->owner;
 
-       if (unlikely(conn->flags & CO_FL_ERROR))
+       if (unlikely(conn->flags & CO_FL_ERROR)) {
+               /* Note that we might as well have been woken up by a handshake handler */
+               s->result |= SRV_CHK_FAILED;
+               __conn_data_stop_both(conn);
                task_wakeup(s->check.task, TASK_WOKEN_IO);
+       }
 
        if (s->result & (SRV_CHK_FAILED|SRV_CHK_PASSED))
                conn_full_close(conn);