BUG/MEDIUM: connections: Make sure we remove CO_FL_SESS_IDLE on disown.
When for some reason the session is not the owner of the connection anymore,
make sure we remove CO_FL_SESS_IDLE, even if we're about to call
conn->mux->destroy(), as the destroy may not destroy the connection
immediately if it's still in use.
This should be backported to 1.9.
u
diff --git a/include/proto/session.h b/include/proto/session.h
index 2ff8e38..eabebb8 100644
--- a/include/proto/session.h
+++ b/include/proto/session.h
@@ -124,12 +124,12 @@
/* We can't keep the connection, let's try to add it to the server idle list */
session_unown_conn(sess, conn);
conn->owner = NULL;
+ conn->flags &= ~CO_FL_SESS_IDLE;
if (!srv_add_to_idle_list(objt_server(conn->target), conn)) {
/* The server doesn't want it, let's kill the connection right away */
conn->mux->destroy(conn->ctx);
return -1;
- } else
- conn->flags &= ~CO_FL_SESS_IDLE;
+ }
return 1;
} else {
conn->flags |= CO_FL_SESS_IDLE;