CLEANUP: connection: use conn_ctrl_ready() instead of checking the flag
It's easier and safer to rely on conn_ctrl_ready() everywhere than to
check the flag itself. It will also simplify adding extra checks later
if needed. Some useless controls for !ctrl have been removed, as the
CTRL_READY flag itself guarantees ctrl is set.
diff --git a/src/connection.c b/src/connection.c
index f85e775..1483f18 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -157,7 +157,7 @@
{
unsigned int f = c->flags;
- if (!(c->flags & CO_FL_CTRL_READY))
+ if (!conn_ctrl_ready(c))
return;
/* update read status if needed */
@@ -192,7 +192,7 @@
{
unsigned int f = c->flags;
- if (!(c->flags & CO_FL_CTRL_READY))
+ if (!conn_ctrl_ready(c))
return;
/* update read status if needed */
@@ -248,7 +248,7 @@
if (conn->flags & CO_FL_SOCK_RD_SH)
goto fail;
- if (!(conn->flags & CO_FL_CTRL_READY))
+ if (!conn_ctrl_ready(conn))
goto fail;
if (!fd_recv_ready(conn->t.sock.fd))