REORG: connection: rename app_cb "data"
Now conn->data will designate the data layer which is the client for
the transport layer. In practice it's the stream interface and will
soon also be the health checks.
diff --git a/include/proto/connection.h b/include/proto/connection.h
index 17bef9b..f43525f 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -412,14 +412,14 @@
conn->flags |= CO_FL_ADDR_TO_SET;
}
-/* prepares a connection with the appropriate app_cb, ctrl and transport layers.
+/* prepares a connection with the appropriate data, ctrl and transport layers.
* The data state and context are set to 0, and the connection's owner is set.
*/
-static inline void conn_prepare(struct connection *conn, const struct app_cb *app,
+static inline void conn_prepare(struct connection *conn, const struct data_cb *data,
const struct protocol *ctrl, const struct xprt_ops *xprt,
void *owner)
{
- conn->app_cb = app;
+ conn->data = data;
conn->ctrl = ctrl;
conn->xprt = xprt;
conn->owner = owner;
diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h
index cbaa966..3472b99 100644
--- a/include/proto/stream_interface.h
+++ b/include/proto/stream_interface.h
@@ -46,7 +46,7 @@
extern struct si_ops si_embedded_ops;
extern struct si_ops si_task_ops;
extern struct si_ops si_conn_ops;
-extern struct app_cb si_conn_cb;
+extern struct data_cb si_conn_cb;
struct task *stream_int_register_handler(struct stream_interface *si,
struct si_applet *app);
diff --git a/include/types/connection.h b/include/types/connection.h
index 9215fa8..c289efa 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -169,14 +169,14 @@
int (*init)(struct connection *conn); /* initialize the transport layer */
};
-/* app_cb describes the data layer's recv and send callbacks which are called
+/* data_cb describes the data layer's recv and send callbacks which are called
* when I/O activity was detected after the transport layer is ready. These
* callbacks are supposed to make use of the xprt_ops above to exchange data
* from/to buffers and pipes.
*/
-struct app_cb {
- void (*recv)(struct connection *conn); /* application-layer recv callback */
- void (*send)(struct connection *conn); /* application-layer send callback */
+struct data_cb {
+ void (*recv)(struct connection *conn); /* data-layer recv callback */
+ void (*send)(struct connection *conn); /* data-layer send callback */
};
/* a target describes what is on the remote side of the connection. */
@@ -202,7 +202,7 @@
struct connection {
const struct xprt_ops *xprt; /* operations at the transport layer */
const struct protocol *ctrl; /* operations at the socket layer */
- const struct app_cb *app_cb; /* application layer callbacks */
+ const struct data_cb *data; /* data layer callbacks */
void *owner; /* pointer to upper layer's entity (eg: stream interface) */
union { /* definitions which depend on connection type */
struct { /*** information used by socket-based connections ***/
diff --git a/src/connection.c b/src/connection.c
index 8966bf7..07225e9 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -78,11 +78,11 @@
/* The data transfer starts here and stops on error and handshakes */
if ((fdtab[fd].ev & (FD_POLL_IN | FD_POLL_HUP | FD_POLL_ERR)) &&
!(conn->flags & (CO_FL_WAIT_RD|CO_FL_WAIT_ROOM|CO_FL_ERROR|CO_FL_HANDSHAKE)))
- conn->app_cb->recv(conn);
+ conn->data->recv(conn);
if ((fdtab[fd].ev & (FD_POLL_OUT | FD_POLL_ERR)) &&
!(conn->flags & (CO_FL_WAIT_WR|CO_FL_WAIT_DATA|CO_FL_ERROR|CO_FL_HANDSHAKE)))
- conn->app_cb->send(conn);
+ conn->data->send(conn);
if (unlikely(conn->flags & CO_FL_ERROR))
goto leave;
diff --git a/src/stream_interface.c b/src/stream_interface.c
index 625ca73..faeddde 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -66,7 +66,7 @@
.chk_snd = stream_int_chk_snd_conn,
};
-struct app_cb si_conn_cb = {
+struct data_cb si_conn_cb = {
.recv = si_conn_recv_cb,
.send = si_conn_send_cb,
};