This patch is mandatory to invert the endpoint and the context in the
conn-stream. There is no common type (at least for now) for the entity
representing a mux (h1s, h2s...), thus we must set its type when the
endpoint is attached to a conn-stream. There is 2 types for the conn-stream
endpoints: the mux (CS_FL_ENDP_MUX) and the applet (CS_FL_ENDP_APP).
printf("0\n");
return;
}
+ SHOW_FLAG(f, CS_FL_ENDP_APP);
+ SHOW_FLAG(f, CS_FL_ENDP_MUX);
SHOW_FLAG(f, CS_FL_WEBSOCKET);
SHOW_FLAG(f, CS_FL_NOT_FIRST);
SHOW_FLAG(f, CS_FL_KILL_CONN);
/* flags set by the mux relayed to the stream */
CS_FL_WEBSOCKET = 0x00200000, /* websocket stream */
+
+ CS_FL_ENDP_MUX = 0x00400000, /* Endpoint is a mux */
+ CS_FL_ENDP_APP = 0x00800000, /* Endpoint is an applet */
};
/* cs_shutr() modes */
}
static inline struct connection *cs_conn(const struct conn_stream *cs)
{
- if (obj_type(cs->end) == OBJ_TYPE_CONN)
+ if (cs->flags & CS_FL_ENDP_MUX)
return __cs_conn(cs);
return NULL;
}
}
static inline struct appctx *cs_appctx(const struct conn_stream *cs)
{
- if (obj_type(cs->end) == OBJ_TYPE_APPCTX)
+ if (cs->flags & CS_FL_ENDP_APP)
return __cs_appctx(cs);
return NULL;
}
}
else if (cs_check(cs))
cs->data_cb = &check_conn_cb;
+ cs->flags |= CS_FL_ENDP_MUX;
}
else if ((appctx = objt_appctx(endp)) != NULL) {
appctx->owner = cs;
cs->si->ops = &si_applet_ops;
cs->data_cb = NULL;
}
+ cs->flags |= CS_FL_ENDP_APP;
}
}