MAJOR: stream/conn_stream: Move the stream-interface into the conn-stream
Thanks to all previous changes, it is now possible to move the
stream-interface into the conn-stream. To do so, some SI functions are
removed and their conn-stream counterparts are added. In addition, the
conn-stream is now responsible to create and release the
stream-interface. While the stream-interfaces were inlined in the stream
structure, there is now a pointer in the conn-stream. stream-interfaces are
now dynamically allocated. Thus a dedicated pool is added. It is a temporary
change because, at the end, the stream-interface structure will most
probably disappear.
diff --git a/src/backend.c b/src/backend.c
index 3da12f8..0fed42a 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1495,9 +1495,9 @@
}
if (avail >= 1) {
- si_attach_conn(cs_si(s->csb), srv_conn);
+ cs_attach_endp(s->csb, &srv_conn->obj_type, srv_conn);
if (srv_conn->mux->attach(srv_conn, s->csb, s->sess) == -1) {
- si_reset_endpoint(cs_si(s->csb));
+ cs_detach_endp(s->csb);
srv_conn = NULL;
}
}
@@ -1571,7 +1571,7 @@
return SF_ERR_INTERNAL; /* how did we get there ? */
}
- si_attach_conn(cs_si(s->csb), srv_conn);
+ cs_attach_endp(s->csb, &srv_conn->obj_type, srv_conn);
#if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negotiation)
if (!srv ||
(srv->use_ssl != 1 || (!(srv->ssl_ctx.alpn_str) && !(srv->ssl_ctx.npn_str)) ||
@@ -2289,7 +2289,7 @@
* Note: the stream-interface will be switched to ST_REQ, ST_ASS or
* ST_TAR and SI_FL_ERR and SI_FL_EXP flags will be unset.
*/
- si_reset_endpoint(cs_si(s->csb));
+ cs_detach_endp(s->csb);
stream_choose_redispatch(s);