]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux: add more methods to mux_ops
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 13 Sep 2017 16:30:23 +0000 (18:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 17:03:23 +0000 (18:03 +0100)
We'll need to support reading/writing from both sides, with buffers and
pipes, as well as retrieving/updating flags.

include/types/connection.h

index 9561406eb19afb6d955ae4b50a81305ed44c4918..66ec1b6b18c2ce2dd2d19099fd5fc6eb5a36aaad 100644 (file)
@@ -266,7 +266,17 @@ struct mux_ops {
        void (*recv)(struct connection *conn);        /* mux-layer recv callback */
        void (*send)(struct connection *conn);        /* mux-layer send callback */
        int  (*wake)(struct connection *conn);        /* mux-layer callback to report activity, mandatory */
+       void (*update_poll)(struct conn_stream *cs);  /* commit cs flags to mux/conn */
+       int  (*rcv_buf)(struct conn_stream *cs, struct buffer *buf, int count); /* Called from the upper layer to get data */
+       int  (*snd_buf)(struct conn_stream *cs, struct buffer *buf, int flags); /* Called from the upper layer to send data */
+       int  (*rcv_pipe)(struct conn_stream *cs, struct pipe *pipe, unsigned int count); /* recv-to-pipe callback */
+       int  (*snd_pipe)(struct conn_stream *cs, struct pipe *pipe); /* send-to-pipe callback */
+       void (*shutr)(struct conn_stream *cs, int clean); /* shutr function */
+       void (*shutw)(struct conn_stream *cs, int clean); /* shutw function */
+
        void (*release)(struct connection *conn);     /* release all resources allocated by the mux */
+       struct conn_stream *(*attach)(struct connection *); /* Create and attach a conn_stream to an outgoing connection */
+       void (*detach)(struct conn_stream *); /* Detach a conn_stream from an outgoing connection, when the request is done */
        char name[8];                                 /* mux layer name, zero-terminated */
 };