MEDIUM: tree-wide: Move flags about shut from the channel to the SC
The purpose of this patch is only a one-to-one replacement, as far as
possible.
CF_SHUTR(_NOW) and CF_SHUTW(_NOW) flags are now carried by the
stream-connecter. CF_ prefix is replaced by SC_FL_ one. Of course, it is not
so simple because at many places, we were testing if a channel was shut for
reads and writes in same time. To do the same, shut for reads must be tested
on one side on the SC and shut for writes on the other side on the opposite
SC. A special care was taken with process_stream(). flags of SCs must be
saved to be able to detect changes, just like for the channels.
diff --git a/src/map.c b/src/map.c
index 9713041..ff6bbf5 100644
--- a/src/map.c
+++ b/src/map.c
@@ -348,7 +348,8 @@
struct stconn *sc = appctx_sc(appctx);
struct pat_ref_elt *elt;
- if (unlikely(sc_ic(sc)->flags & CF_SHUTW)) {
+ /* FIXME: Don't watch the other side !*/
+ if (unlikely(chn_cons(sc_ic(sc))->flags & SC_FL_SHUTW)) {
/* If we're forced to shut down, we might have to remove our
* reference to the last ref_elt being dumped.
*/