MEDIUM: connection: panic when calling FD-specific functions on FD-less conns
Certain functions cannot be called on an FD-less conn because they are
normally called as part of the protocol-specific setup/teardown sequence.
Better place a few BUG_ON() to make sure none of them is called in other
situations. If any of them would trigger in ambiguous conditions, it would
always be possible to replace it with an error.
diff --git a/src/check.c b/src/check.c
index da2deab..7e6430f 100644
--- a/src/check.c
+++ b/src/check.c
@@ -744,6 +744,8 @@
if (!conn_ctrl_ready(conn))
return 0;
+ BUG_ON(conn->flags & CO_FL_FDLESS);
+
if (getsockopt(conn->handle.fd, SOL_SOCKET, SO_ERROR, &skerr, &lskerr) == 0)
errno = skerr;