MEDIUM: checks: make use of chk_report_conn_err() for connection errors
authorWilly Tarreau <w@1wt.eu>
Fri, 24 Jan 2014 15:10:57 +0000 (16:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 24 Jan 2014 15:15:04 +0000 (16:15 +0100)
Checks used not to precisely report the errors that were detected at the
connection layer (eg: too many SSL connections). Using chk_report_conn_err()
makes this possible.

src/checks.c

index b990d61..ac1bbed 100644 (file)
@@ -1606,12 +1606,14 @@ static struct task *process_chk(struct task *t)
 
                case SN_ERR_SRVTO: /* ETIMEDOUT */
                case SN_ERR_SRVCL: /* ECONNREFUSED, ENETUNREACH, ... */
-                       set_server_check_status(check, HCHK_STATUS_L4CON, strerror(errno));
+                       conn->flags |= CO_FL_ERROR;
+                       chk_report_conn_err(conn, errno, 0);
                        break;
                case SN_ERR_PRXCOND:
                case SN_ERR_RESOURCE:
                case SN_ERR_INTERNAL:
-                       set_server_check_status(check, HCHK_STATUS_SOCKERR, NULL);
+                       conn->flags |= CO_FL_ERROR;
+                       chk_report_conn_err(conn, 0, 0);
                        break;
                }