]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: connection: rename app_cb "data"
authorWilly Tarreau <w@1wt.eu>
Tue, 2 Oct 2012 22:41:04 +0000 (00:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Oct 2012 20:26:10 +0000 (22:26 +0200)
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.

include/proto/connection.h
include/proto/stream_interface.h
include/types/connection.h
src/connection.c
src/stream_interface.c

index 17bef9bd955c5ccbb8bae2da3394596418aed99c..f43525fb29b04f955c3645bfec1bdd76fbcfa642 100644 (file)
@@ -412,14 +412,14 @@ static inline void conn_get_to_addr(struct connection *conn)
        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;
index cbaa966fe567e0f5419ffa732c34bee273fd0b10..3472b990a0b9884f7ad577b50dc05c117ee8fba8 100644 (file)
@@ -46,7 +46,7 @@ void stream_sock_read0(struct stream_interface *si);
 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);
index 9215fa8fdfed6893c60887eda72e823362eb10b2..c289efa9a77f8407152d1336988d2a7a4fe03261 100644 (file)
@@ -169,14 +169,14 @@ struct xprt_ops {
        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 target {
 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 ***/
index 8966bf70f69d8bdaead7bd9782b9b4a15b87fa16..07225e9d3be85dc8ad4d027e50aa04f8814b3060 100644 (file)
@@ -78,11 +78,11 @@ int conn_fd_handler(int fd)
        /* 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;
index 625ca73bb2a1ccdbaf41ee73d49d468029442930..faedddedfb934bdce03c9c3f8a2c3c169073e779 100644 (file)
@@ -66,7 +66,7 @@ struct si_ops si_conn_ops = {
        .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,
 };