MAJOR: conn-stream: Share endpoint struct between the CS and the mux/applet

The conn-stream endpoint is now shared between the conn-stream and the
applet or the multiplexer. If the mux or the applet is created first, it is
responsible to also create the endpoint and share it with the conn-stream.
If the conn-stream is created first, it is the opposite.

When the endpoint is only owned by an applet or a mux, it is called an
orphan endpoint (there is no conn-stream). When it is only owned by a
conn-stream, it is called a detached endpoint (there is no mux/applet).

The last entity that owns an endpoint is responsible to release it. When a
mux or an applet is detached from a conn-stream, the conn-stream
relinquishes the endpoint to recreate a new one. This way, the endpoint
state is never lost for the mux or the applet.
This commit is contained in:
Christopher Faulet
2022-03-23 15:15:29 +01:00
parent cb2fa368e9
commit 9ec2f4dc7c
26 changed files with 248 additions and 162 deletions

View File

@@ -196,6 +196,8 @@ void show_endp_flags(unsigned int f)
SHOW_FLAG(f, CS_EP_SHWN);
SHOW_FLAG(f, CS_EP_SHRR);
SHOW_FLAG(f, CS_EP_SHRD);
SHOW_FLAG(f, CS_EP_ORPHAN);
SHOW_FLAG(f, CS_EP_DETACHED);
SHOW_FLAG(f, CS_EP_T_APPLET);
SHOW_FLAG(f, CS_EP_T_MUX);