MEDIUM: conn_stream: Add a pointer to the app object into the conn-stream
In the same way the conn-stream has a pointer to the stream endpoint , this
patch adds a pointer to the application entity in the conn-stream
structure. For now, it is a stream or a health-check. It is mandatory to
merge the stream-interface with the conn-stream.
diff --git a/src/conn_stream.c b/src/conn_stream.c
index 7b53ecc..41d4a2e 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -22,14 +22,16 @@
/* Tries to allocate a new conn_stream and initialize its main fields. On
* failure, nothing is allocated and NULL is returned.
*/
-struct conn_stream *cs_new(enum obj_type *endp)
+struct conn_stream *cs_new(enum obj_type *endp, void *ctx, enum obj_type *app, void *data, const struct data_cb *data_cb)
{
struct conn_stream *cs;
cs = pool_alloc(pool_head_connstream);
if (unlikely(!cs))
return NULL;
- cs_init(cs, endp);
+ cs_init(cs);
+ cs_attach_endp(cs, endp, ctx);
+ cs_attach_app(cs, app, data, data_cb);
return cs;
}