BUG/MEDIUM: conn-stream: Don't erase endpoint flags on reset
Only CS_EP_ERROR flag is now removed from the endpoint when a reset is
performed. When a new the endpoint is allocated, flags are preserved. It is
the caller responsibility to remove other flags, depending on its need.
Concretly, during a connection retry or a L7 retry, we must preserve
flags. In tcpcheck and the CLI, we reset flags.
This patch is 2.6-specific. No backport needed.
diff --git a/src/check.c b/src/check.c
index 2db82c4..d65850d 100644
--- a/src/check.c
+++ b/src/check.c
@@ -1164,7 +1164,12 @@
TRACE_DEVEL("closing current connection", CHK_EV_TASK_WAKE|CHK_EV_HCHK_RUN, check);
check->state &= ~CHK_ST_CLOSE_CONN;
conn = NULL;
- cs_reset_endp(check->cs); /* error will be handled by tcpcheck_main() */
+ if (!cs_reset_endp(check->cs)) {
+ /* error will be handled by tcpcheck_main().
+ * On success, remove all flags except CS_EP_DETACHED
+ */
+ check->cs->endp->flags &= CS_EP_DETACHED;
+ }
tcpcheck_main(check);
}
if (check->result == CHK_RES_UNKNOWN) {