MINOR: connection: introduce conn_stream
This patch introduces a new struct conn_stream. It's the stream-side of
a multiplexed connection. A pool is created and destroyed on exit. For
now the conn_streams are not used at all.
diff --git a/src/connection.c b/src/connection.c
index b61a9dd..2e081d8 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -28,6 +28,7 @@
#endif
struct pool_head *pool2_connection;
+struct pool_head *pool2_connstream;
struct xprt_ops *registered_xprt[XPRT_ENTRIES] = { NULL, };
/* List head of all known muxes for ALPN */
@@ -39,7 +40,19 @@
int init_connection()
{
pool2_connection = create_pool("connection", sizeof (struct connection), MEM_F_SHARED);
- return pool2_connection != NULL;
+ if (!pool2_connection)
+ goto fail_conn;
+
+ pool2_connstream = create_pool("conn_stream", sizeof(struct conn_stream), MEM_F_SHARED);
+ if (!pool2_connstream)
+ goto fail_cs;
+
+ return 1;
+ fail_cs:
+ pool_destroy2(pool2_connection);
+ pool2_connection = NULL;
+ fail_conn:
+ return 0;
}
/* I/O callback for fd-based connections. It calls the read/write handlers