BUG/MEDIUM: connections: Remove CS_FL_EOS | CS_FL_REOS on retry.
CS_FL_EOS | CS_FL_REOS can be set by the mux if the connection failed, so make
sure we remove them before retrying to connect, or it may lead to a premature
close of the connection.
diff --git a/src/backend.c b/src/backend.c
index 24fcb72..f494773 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1132,7 +1132,7 @@
old_conn = srv_conn = cs_conn(srv_cs);
if (old_conn) {
old_conn->flags &= ~(CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_SOCK_WR_SH);
- srv_cs->flags &= ~CS_FL_ERROR;
+ srv_cs->flags &= ~(CS_FL_ERROR | CS_FL_EOS | CS_FL_REOS);
reuse = 1;
}
} else {